diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..5a2d1f4a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,41 @@ +name: tests + +on: [ push ] + +jobs: + tests: + name: Python ${{ matrix.python-version }} + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + python-version: [ 3.6, 3.7, 3.8 ] + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Restore cached dependencies + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }} + restore-keys: ${{ runner.os }}-pip-${{ matrix.python-version }}- + - name: Install dependencies + run: | + apt-get update -y && apt-get install -y libnetcdf-dev libnetcdff-dev udunits-bin + pip install wheel + pip install -e ".[dev]" + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + # - name: Test with coverage + # run: coverage run --source pyschism -m nose --nologcapture --verbose + # - name: Generate coverage report + # run: coverage report -m \ No newline at end of file diff --git a/.gitignore b/.gitignore index 916334e7..fc8147f7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ build/ dist/ *.egg* __pycache__ +*_env diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..6c16e101 --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +default: error + +coverage: + @coverage run --source pyschism -m nose --rednose --nologcapture --verbose && coverage report -m && coverage-badge -f -o tests/coverage.svg && rm -rf .coverage + +badge: + @$(shell git diff --exit-code -s tests/coverage.svg) + @if ! [ $(.SHELLSTATUS) = 0 ]; then git add tests/coverage.svg && git commit -m "Updated coverage badge."; fi + +error: + @echo -e "ERROR: Argument required." + @exit 2 \ No newline at end of file diff --git a/README.md b/README.md index e6c14a6b..f6e6f46c 100644 --- a/README.md +++ b/README.md @@ -63,5 +63,5 @@ hgrid.write("/path/to/output/file.2dm", fmt='2dm') ``` --- Questions, comments and suggestions are welcome. Please follow the instructions on the `CONTRIBUTING.md` file for contributions. For bug reports and feature requests, please open an issue using the issue tracker. -Author contact: Jaime.Calzada@noaa.gov +Author contact: jrcalzada@wm.edu diff --git a/setup.py b/setup.py index bd0d651b..e15e5a84 100755 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ long_description_content_type="text/markdown", url=meta['url'], packages=setuptools.find_packages(), - python_requires='>=3.6, <=3.8', + python_requires='>=3.6, <3.9', setup_requires=['wheel', 'setuptools_scm', 'setuptools>=41.2'], include_package_data=True, extras_require={'dev': ['coverage', 'flake8', 'nose']},