From 68a3a8fd51671583e2e12fd957e68d7984d9c400 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Wed, 24 Mar 2021 15:54:25 -0300 Subject: [PATCH 1/3] GHA for the tests --- .github/workflows/tests.yml | 46 +++++++++++++++++++++++++++++++++++++ .travis.yml | 31 ------------------------- pyproject.toml | 2 +- requirements-dev.txt | 2 ++ 4 files changed, 49 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..417d12c --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,46 @@ +name: Tests + +on: + pull_request: + push: + branches: [master] + +jobs: + run: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + python-version: ["3.7", "3.8"] + # 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"] + include: + - python-version: "3.9" + numpy-version: "1.20" + + 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..8c3c514 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,14 +9,6 @@ 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" @@ -51,14 +43,6 @@ script: 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 +55,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 From 75161e5ea7ae060eba5cec8dd2b8dead25053ada Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Fri, 26 Mar 2021 14:13:45 -0300 Subject: [PATCH 2/3] exclude numpy 1.17 on Pyhton 3.9 --- .github/workflows/tests.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 417d12c..beddb8e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,17 +9,16 @@ jobs: run: runs-on: ${{ matrix.os }} strategy: - fail-fast: false matrix: + python-version: ["3.7", "3.8", "3.9"] os: [windows-latest, ubuntu-latest, macos-latest] - python-version: ["3.7", "3.8"] # 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"] - include: + exclude: - python-version: "3.9" - numpy-version: "1.20" - + numpy-version: "1.17" + steps: - uses: actions/checkout@v2 From c67c59cc95e8349e0a63ad16c2f583e3fb5e4752 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Fri, 26 Mar 2021 14:31:49 -0300 Subject: [PATCH 3/3] move tarball tests to GHA --- .github/workflows/tarball-tests.yml | 34 +++++++++++++++++++++++++++++ .travis.yml | 9 -------- 2 files changed, 34 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/tarball-tests.yml 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/.travis.yml b/.travis.yml index 8c3c514..a193960 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,8 +11,6 @@ matrix: include: - name: "docs" env: NUMPY=1 PY=3 - - name: "tarball" - env: NUMPY=1 PY=3 before_install: # Install miniconda and create TEST env. @@ -36,13 +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 == 'docs' ]]; then pushd docs