diff --git a/.github/workflows/tarball-tests.yml b/.github/workflows/tarball-tests.yml new file mode 100644 index 0000000..3a4ffde --- /dev/null +++ b/.github/workflows/tarball-tests.yml @@ -0,0 +1,34 @@ +name: Tarball tests + +on: + pull_request: + push: + branches: [master] + +jobs: + run: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Setup Conda + uses: s-weigand/setup-conda@v1 + with: + activate-conda: false + conda-channels: conda-forge + + - name: Create environment + shell: bash -l {0} + run: | + conda create --name TEST python=3 python-build cython numpy --file requirements-dev.txt + source activate TEST + conda info --all + conda list + + - name: Tarball + shell: bash -l {0} + run: | + source activate TEST + python -m build --skip-dependencies --sdist --wheel . + check-manifest --verbose + twine check dist/* diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..beddb8e --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,45 @@ +name: Tests + +on: + pull_request: + push: + branches: [master] + +jobs: + run: + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9"] + os: [windows-latest, ubuntu-latest, macos-latest] + # Oldest one based on NEP-29 and latest one. + # See https://numpy.org/neps/nep-0029-deprecation_policy.html + numpy-version: ["1.17", "1.20"] + exclude: + - python-version: "3.9" + numpy-version: "1.17" + + steps: + - uses: actions/checkout@v2 + + - name: Setup Conda + uses: s-weigand/setup-conda@v1 + with: + activate-conda: false + conda-channels: conda-forge + + - name: Python ${{ matrix.python-version }} numpy ${{ matrix.numpy-version }} + shell: bash -l {0} + run: | + conda create --name TEST python=${{ matrix.python-version }} python-build cython numpy=${{ matrix.numpy-version }} --file requirements-dev.txt + source activate TEST + pip install -e . --no-deps --force-reinstall + conda info --all + conda list + + - name: Tests + shell: bash -l {0} + run: | + source activate TEST + python -c "import numpy; print(f'Running numpy {numpy.__version__}')" + pytest -s -rxs -v gsw/tests diff --git a/.travis.yml b/.travis.yml index bdc8b78..a193960 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,18 +9,8 @@ env: matrix: fast_finish: true include: - - name: "py37-np116" - env: PY=3.7 NUMPY=1.16 - - name: "py37-np119" - env: PY=3.7 NUMPY=1.19 - - name: "py38-np116" - env: PY=3.8 NUMPY=1.16 - - name: "py38-np119" - env: PY=3.8 NUMPY=1.19 - name: "docs" env: NUMPY=1 PY=3 - - name: "tarball" - env: NUMPY=1 PY=3 before_install: # Install miniconda and create TEST env. @@ -44,21 +34,6 @@ install: - pip install -e . --no-deps --force-reinstall script: - - | - if [[ $TRAVIS_JOB_NAME == 'tarball' ]]; then - python -m pep517.build --source --binary . --out-dir dist - check-manifest --verbose - twine check dist/* - fi - - - | - if [[ $TRAVIS_JOB_NAME == py* ]]; then - cp -r gsw/tests /tmp - pushd /tmp - pytest -s -rxs -v tests - popd - fi - - | if [[ $TRAVIS_JOB_NAME == 'docs' ]]; then pushd docs @@ -71,18 +46,3 @@ script: python -m doctr deploy --build-tags --key-path github_deploy_key.enc --built-docs docs/_build/html . fi fi - - -deploy: - skip_cleanup: true - provider: pypi - user: ocefpaf - password: - secure: aC6ZixeGhCmxdn3a4skQJHIK9Ffj/p5O1cOjHKXZh1vhHy1t5oEfk1HayWdLq2wRwODx9+Ern6ZsWRv+jiSPiqlHgOL74SHT+ByAX/WaylhhySS5JeTN+jT0vOoB7IZRtAb1QVA7mIifbrLTyHw+jX5pUt+ue1LI5zg+M9ny3E0gFYut6t3C2zbTCACmk3S5+3DXn4BT5aXJhbnF2NKTNvEzhXuL0Vu08N8pClTIQM8ZR2fniqVcM8oCPL/Ecouf7Z6L5ofl8cqdloe9e50/01XCKQs0EUWVko8XlBiKvjOUoUn3oB1rif8hahQpHIrDWNShvBqp1LE/Sxmv2FmtC0C+WAqivMqWyLOxrtZnDpk0/0DGObQ652Ypr2WocC1E2wub7rf1KinNcWmgQGIPzQbUERUYcc2yW1pRfT2oos0QLTzWgTTGlImAeuNo1s9ds7dSYcQCL6z+M0Nq3nZ71gmir22hx/j1N0OQzLBMgxz3m6+pZz6nrNT0YQTFqs/y2A6R8yf46+vySGbzoMKS0OmTmFN6Fr0URoF0oHmztb6y+aVLvHPdtfLV/ryR7DsLKXn7j1FfHoEJNoojCecgL0EZDqWiSX6wLwdTnEkZK56ZTAJGjKPFTPtfxaNLdmc+kweGhIXINp4qacWASIYBm1vldToSC2KiRo+aPKcYRaQ= - distributions: sdist - upload_docs: no - on: - repo: TEOS-10/GSW-Python - tags: true - all_branches: master - condition: '$TRAVIS_JOB_NAME == "deploy"' diff --git a/pyproject.toml b/pyproject.toml index 70dccb2..95051bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["pip >9.0.1", "setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4", "cython", "numpy"] +requires = ["pip >9.0.1", "setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4", "cython", "oldest-supported-numpy", "build"] build-backend = "setuptools.build_meta" diff --git a/requirements-dev.txt b/requirements-dev.txt index f48dff3..7ba2df0 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,3 +6,5 @@ setuptools_scm sphinx sphinx_rtd_theme twine +xarray +dask