Skip to content

Commit

Permalink
Merge branch 'master' into shebang
Browse files Browse the repository at this point in the history
  • Loading branch information
loeiten committed Jan 18, 2021
2 parents 9f0abfd + e9a411f commit e05d5aa
Show file tree
Hide file tree
Showing 48 changed files with 3,194 additions and 2,699 deletions.
10 changes: 10 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[run]
branch = true
omit = */BOUT-dev/*

[report]
exclude_lines =
if __name__ == .__main__.:
omit =
*/tests/*
*/docs/*
42 changes: 42 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Lint

on:
# Run each time we push and pull requests
push:
pull_request:
# Cron job
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows#scheduled-events-schedule
schedule:
# https://crontab.guru/#0_0_1_*_*
- cron: "0 0 1 * *"

jobs:
linting:
runs-on: ubuntu-latest

steps:
# Use the v2 tag of: https://github.com/actions/checkout
- name: Checkout repo
uses: actions/checkout@v2

- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Set up Python ${{ matrix.python-version }}
# Use the v2 tag of: https://github.com/actions/setup-python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
# https://github.com/PyCQA/pylint/issues/352
# pylint need the requirements to do the checks as the pre-commit repo is local
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pre-commit
pip install .
- name: Lint
run: pre-commit run --all-files
32 changes: 16 additions & 16 deletions .github/workflows/python_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
51 changes: 51 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Test

on:
# Run each time we push and pull requests
push:
pull_request:
# Cron job
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows#scheduled-events-schedule
schedule:
# https://crontab.guru/#0_0_1_*_*
- cron: "0 0 1 * *"

jobs:
# As we are running on different environments, we are splitting the jobs
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobs
local:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
python-version: [3.7, 3.8]
os: [ubuntu-latest]

steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Setup prerequisites
run:
sudo apt update && sudo apt install -y libhdf5-serial-dev netcdf-bin
libnetcdf-dev libsm6 libxext6 libxrender-dev libxt6 libgl1-mesa-glx
libfontconfig libxkbcommon-x11-0

- name: Install dependencies
run: |
pip install setuptools_scm pytest-cov
pip install .
- name: Test local run
run: |
pytest --cov=./
- name: Upload to codecov
run: |
pip install codecov
codecov
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,3 @@ dmypy.json
.DS_Store
.idea/
*.sw[po]

29 changes: 29 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# NOTE: The versions can be updated by calling
# pre-commit autoupdate
repos:
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black

- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
hooks:
- id: flake8

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer

- repo: https://github.com/prettier/pre-commit
rev: 57f39166b5a5a504d6808b87ab98d41ebf095b46
hooks:
- id: prettier
args: [--prose-wrap=always, --print-width=88]

- repo: https://github.com/PyCQA/isort
rev: 5.7.0
hooks:
- id: isort
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

21 changes: 8 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,21 @@
[![PEP8](https://img.shields.io/badge/code%20style-PEP8-brightgreen.svg)](https://www.python.org/dev/peps/pep-0008/)
[![License](https://img.shields.io/badge/license-LGPL--3.0-blue.svg)](https://github.com/boutproject/boututils/blob/master/LICENSE)

pip-package of what was previously found in
`BOUT-dev/tools/pylib/boututils`
Note that `BOUT-dev/tools/pylib/boututils` will likely be replaced by this repo
in `BOUT++ v4.3.0`.
See [this issue](https://github.com/boutproject/BOUT-dev/issues/1347),
pip-package of what was previously found in `BOUT-dev/tools/pylib/boututils` Note that
`BOUT-dev/tools/pylib/boututils` will likely be replaced by this repo in
`BOUT++ v4.3.0`. See [this issue](https://github.com/boutproject/BOUT-dev/issues/1347),
[this pull request](https://github.com/boutproject/BOUT-dev/pull/1766) and
[this pull request](https://github.com/boutproject/BOUT-dev/pull/1740) for details.

> **NOTE**: This package will likely be superseded by
[`xBOUT`](https://github.com/boutproject/xBOUT) in the near future
> [`xBOUT`](https://github.com/boutproject/xBOUT) in the near future
# Dependencies

`boututils` depends on
[`netcfd4`](https://github.com/Unidata/netcdf4-python) which requires
[`HDF5`](https://www.h5py.org) and
[`netcdf-4`](https://github.com/Unidata/netcdf-c/releases) are
installed, and that the `nc-config` utility is in your `PATH`. This
can be install with
`boututils` depends on [`netcfd4`](https://github.com/Unidata/netcdf4-python) which
requires [`HDF5`](https://www.h5py.org) and
[`netcdf-4`](https://github.com/Unidata/netcdf-c/releases) are installed, and that the
`nc-config` utility is in your `PATH`. This can be install with

```
sudo apt-get install libhdf5-serial-dev netcdf-bin libnetcdf-dev
Expand All @@ -36,4 +32,3 @@ in ubuntu
# Install

`pip install boututils`

Loading

0 comments on commit e05d5aa

Please sign in to comment.