From 3a85441adf8c601fab37c472ec82f65d90e755ac Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Fri, 26 May 2023 15:28:03 -0300 Subject: [PATCH 01/10] provision-with-micromamba is deprecated --- .github/workflows/deploy-docs.yml | 27 ++++++++++++------------- .github/workflows/pypi.yml | 2 +- .github/workflows/tests.yml | 33 +++++++++++++------------------ 3 files changed, 28 insertions(+), 34 deletions(-) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index f1c57399..c61ff241 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -19,33 +19,32 @@ jobs: with: fetch-depth: 0 - - name: Setup Micromamba - uses: mamba-org/provision-with-micromamba@main + - name: Setup Micromamba ${{ matrix.python-version }} + uses: mamba-org/setup-micromamba@v1 with: - environment-file: false - - - name: Build environment + environment-name: TEST + init-shell: bash + create-args: >- + python=3 pip + --file requirements.txt + --file docs/requirements.txt + --channel conda-forge + + - name: Install ioos_qc shell: bash -l {0} run: | - micromamba create --name TEST python=3 --file requirements.txt --file docs/requirements.txt --channel conda-forge - micromamba activate TEST python -m pip install -e . --no-deps --force-reinstall - - name: Get the version - id: get_version - run: echo ::set-output name=VERSION::$(python setup.py --version) - - name: Build documentation shell: bash -l {0} - run: | + run: > set -e - micromamba activate TEST pushd docs make clean html linkcheck popd - name: Deploy - if: github.event_name == 'release' || github.event_name == 'push' + if: success() && github.event_name == 'release' uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 9b157d36..0288728f 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -26,7 +26,7 @@ jobs: - name: Install build tools run: | - python -m pip install --upgrade pip wheel setuptools setuptools_scm build twine + python -m pip install --upgrade pip build twine shell: bash - name: Build binary wheel diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f54a5a4a..871ea9c7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10", "3.11"] os: [ubuntu-latest] numba: [true, false] fail-fast: false @@ -18,35 +18,30 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Setup Micromamba - uses: mamba-org/provision-with-micromamba@main + - name: Setup Micromamba ${{ matrix.python-version }} + uses: mamba-org/setup-micromamba@v1 with: - environment-file: false - - - name: Python ${{ matrix.python-version }} + environment-name: TEST + init-shell: bash + create-args: >- + python=3 pip + --file requirements.txt + --file tests/requirements.txt + --channel conda-forge + + - name: Install ioos_qc shell: bash -l {0} run: | - micromamba create --name TEST python=${{ matrix.python-version }} --file requirements.txt --file tests/requirements.txt --channel conda-forge - micromamba activate TEST - pip install -e . --no-deps --force-reinstall + python -m pip install -e . --no-deps --force-reinstall - name: numba # numba is listed in requirements.txt so we need to remove it below. if: ${{ ! matrix.numba }} shell: bash -l {0} run: | - micromamba activate TEST micromamba remove numba - - name: Debug conda - shell: bash -l {0} - run: | - micromamba activate TEST - micromamba info --all - micromamba list - - name: Tests shell: bash -l {0} run: | - micromamba activate TEST - python -m pytest --disable-warnings + python -m pytest --disable-warnings From 0729e2d67cebae7a1ba23bbe8d3342b2dcfc0f50 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Mon, 29 May 2023 09:42:58 -0300 Subject: [PATCH 02/10] fix py version --- .github/workflows/deploy-docs.yml | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index c61ff241..b31c4ce1 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -19,7 +19,7 @@ jobs: with: fetch-depth: 0 - - name: Setup Micromamba ${{ matrix.python-version }} + - name: Setup Micromamba uses: mamba-org/setup-micromamba@v1 with: environment-name: TEST diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 871ea9c7..4c993b97 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,7 +24,7 @@ jobs: environment-name: TEST init-shell: bash create-args: >- - python=3 pip + python=${{ matrix.python-version }} pip --file requirements.txt --file tests/requirements.txt --channel conda-forge From 0b42ecbe3491be4a2dda7d31231cf193441e68ca Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Thu, 14 Mar 2024 14:44:05 -0300 Subject: [PATCH 03/10] fix codespell --- docs/source/examples/usage/storms_qc_test_1054.ipynb | 6 +++--- docs/source/examples/usage/storms_qc_test_1055.ipynb | 6 +++--- docs/source/examples/usage/storms_qc_test_ncCF_error.ipynb | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/source/examples/usage/storms_qc_test_1054.ipynb b/docs/source/examples/usage/storms_qc_test_1054.ipynb index f3c04bdf..ebf29b3c 100644 --- a/docs/source/examples/usage/storms_qc_test_1054.ipynb +++ b/docs/source/examples/usage/storms_qc_test_1054.ipynb @@ -1007,7 +1007,7 @@ "xs = XarrayStream(data_xr, time=\"time\", lat=\"latitude\", lon=\"longitude\")\n", "qc_results = xs.run(c)\n", "\n", - "# Since we may want to re-use the results in multiple\n", + "# Since we may want to reuse the results in multiple\n", "# stores we want to evaluate the checks now so it isn't\n", "# a generator. This is going to run all of the checks!\n", "qc_results = list(qc_results)\n", @@ -1756,7 +1756,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -1770,7 +1770,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.2" + "version": "3.12.2" } }, "nbformat": 4, diff --git a/docs/source/examples/usage/storms_qc_test_1055.ipynb b/docs/source/examples/usage/storms_qc_test_1055.ipynb index 13ea5ed2..7207b504 100644 --- a/docs/source/examples/usage/storms_qc_test_1055.ipynb +++ b/docs/source/examples/usage/storms_qc_test_1055.ipynb @@ -968,7 +968,7 @@ "xs = XarrayStream(data_xr, time=\"time\", lat=\"latitude\", lon=\"longitude\")\n", "qc_results = xs.run(c)\n", "\n", - "# Since we may want to re-use the results in multiple\n", + "# Since we may want to reuse the results in multiple\n", "# stores we want to evaluate the checks now so it isn't\n", "# a generator. This is going to run all of the checks!\n", "qc_results = list(qc_results)" @@ -1716,7 +1716,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -1730,7 +1730,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.2" + "version": "3.12.2" } }, "nbformat": 4, diff --git a/docs/source/examples/usage/storms_qc_test_ncCF_error.ipynb b/docs/source/examples/usage/storms_qc_test_ncCF_error.ipynb index f709514c..1d156e5f 100644 --- a/docs/source/examples/usage/storms_qc_test_ncCF_error.ipynb +++ b/docs/source/examples/usage/storms_qc_test_ncCF_error.ipynb @@ -1003,7 +1003,7 @@ "xs = XarrayStream(data_xr, time=\"time\", lat=\"latitude\", lon=\"longitude\")\n", "qc_results = xs.run(c)\n", "\n", - "# Since we may want to re-use the results in multiple\n", + "# Since we may want to reuse the results in multiple\n", "# stores we want to evaluate the checks now so it isn't\n", "# a generator. This is going to run all of the checks!\n", "qc_results = list(qc_results)\n", @@ -1717,7 +1717,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -1731,7 +1731,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.2" + "version": "3.12.2" } }, "nbformat": 4, From 2a3181ba232f8fca1cae775693e7475bc02c0c73 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Thu, 14 Mar 2024 14:44:17 -0300 Subject: [PATCH 04/10] update pre-commits --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4f429679..8430946b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.5.0 hooks: - id: trailing-whitespace - id: check-ast @@ -10,12 +10,12 @@ repos: - id: file-contents-sorter - repo: https://github.com/PyCQA/flake8 - rev: 3.9.2 + rev: 7.0.0 hooks: - id: flake8 - repo: https://github.com/codespell-project/codespell - rev: v2.2.1 + rev: v2.2.6 hooks: - id: codespell exclude: > From e85fa8d94d58de4ae0d7d0a7ad5b521f9fbedf6d Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Thu, 14 Mar 2024 15:30:00 -0300 Subject: [PATCH 05/10] pin numba for now --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ca237524..527264bd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ geographiclib geojson h5netcdf jsonschema -numba +numba<0.57 numpy>=1.14 pandas pyparsing From 52df247d1719440983bcd89f12d6dd15ec4a6e01 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Thu, 14 Mar 2024 15:30:26 -0300 Subject: [PATCH 06/10] input data must be the tz as test data --- tests/test_config.py | 12 ++++++------ tests/test_streams.py | 32 ++++++++++++++++---------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/tests/test_config.py b/tests/test_config.py index c32c37d9..a98b35fa 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -112,8 +112,8 @@ def setUp(self): config_str = """ region: something window: - starting: 2020-01-01T00:00:00Z - ending: 2020-04-01T00:00:00Z + starting: 2020-01-01T00:00:00 + ending: 2020-04-01T00:00:00 streams: variable1: qartod: @@ -171,8 +171,8 @@ def setUp(self): type: Point coordinates: [-72, 34] window: - starting: 2020-01-01T00:00:00Z - ending: 2020-04-01T00:00:00Z + starting: 2020-01-01T00:00:00 + ending: 2020-04-01T00:00:00 streams: variable1: qartod: @@ -188,8 +188,8 @@ def setUp(self): type: Point coordinates: [-80,40] window: - starting: 2020-01-01T00:00:00Z - ending: 2020-04-01T00:00:00Z + starting: 2020-01-01T00:00:00 + ending: 2020-04-01T00:00:00 streams: variable1: qartod: diff --git a/tests/test_streams.py b/tests/test_streams.py index 16097991..caa26c16 100644 --- a/tests/test_streams.py +++ b/tests/test_streams.py @@ -28,8 +28,8 @@ def setUp(self): config = """ region: something window: - starting: 2020-01-01T00:00:00Z - ending: 2020-04-01T00:00:00Z + starting: 2020-01-01T00:00:00 + ending: 2020-04-01T00:00:00 streams: variable1: qartod: @@ -146,8 +146,8 @@ def setUp(self): config = """ region: something window: - starting: 2020-01-01T00:00:00Z - ending: 2020-04-01T00:00:00Z + starting: 2020-01-01T00:00:00 + ending: 2020-04-01T00:00:00 streams: variable1: qartod: @@ -206,8 +206,8 @@ def setUp(self): config = """ region: something window: - starting: 2020-01-01T00:00:00Z - ending: 2020-04-01T00:00:00Z + starting: 2020-01-01T00:00:00 + ending: 2020-04-01T00:00:00 streams: variable1: qartod: @@ -271,8 +271,8 @@ def setUp(self): config = """ region: something window: - starting: 2020-01-01T00:00:00Z - ending: 2020-04-01T00:00:00Z + starting: 2020-01-01T00:00:00 + ending: 2020-04-01T00:00:00 streams: variable1: qartod: @@ -336,8 +336,8 @@ def setUp(self): contexts: - region: something window: - starting: 2020-01-01T00:00:00Z - ending: 2020-02-01T00:00:00Z + starting: 2020-01-01T00:00:00 + ending: 2020-02-01T00:00:00 streams: variable1: qartod: @@ -351,8 +351,8 @@ def setUp(self): fail_span: [22, 25] - region: something else window: - starting: 2020-02-01T00:00:00Z - ending: 2020-03-01T00:00:00Z + starting: 2020-02-01T00:00:00 + ending: 2020-03-01T00:00:00 streams: variable1: qartod: @@ -423,8 +423,8 @@ def setUp(self): contexts: - region: something window: - starting: 2020-01-01T00:00:00Z - ending: 2020-02-01T00:00:00Z + starting: 2020-01-01T00:00:00 + ending: 2020-02-01T00:00:00 streams: variable1: qartod: @@ -438,8 +438,8 @@ def setUp(self): fail_span: [22, 25] - region: something else window: - starting: 2020-02-01T00:00:00Z - ending: 2020-03-01T00:00:00Z + starting: 2020-02-01T00:00:00 + ending: 2020-03-01T00:00:00 streams: variable1: qartod: From 1f658d5bbbff7934d2862e6e273dedb996dc87b7 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Thu, 14 Mar 2024 15:49:57 -0300 Subject: [PATCH 07/10] separate extras and dev --- requirements-dev.txt | 7 +++++++ requirements.txt | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 requirements-dev.txt diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 00000000..35c16a46 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,7 @@ +bokeh +dask +flake8 +nco +numba<0.57 +pytest +pytest-flake8>=1.0.4 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 527264bd..b80b1699 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,7 @@ -bokeh geographiclib geojson h5netcdf jsonschema -numba<0.57 numpy>=1.14 pandas pyparsing From e9c76344be8c6ac64cc163ec52a5b6805f02c8a1 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Thu, 14 Mar 2024 15:52:57 -0300 Subject: [PATCH 08/10] unify tests, skip numba on modern python --- .github/workflows/tests.yml | 7 ++++++- requirements-dev.txt | 4 +++- tests/requirements.txt | 6 ------ 3 files changed, 9 insertions(+), 8 deletions(-) delete mode 100644 tests/requirements.txt diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4c993b97..2f5544c5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,6 +13,11 @@ jobs: python-version: ["3.8", "3.9", "3.10", "3.11"] os: [ubuntu-latest] numba: [true, false] + exclude: + - python-version: "3.11" + numba: true + - python-version: "3.12" + numba: true fail-fast: false steps: @@ -26,7 +31,7 @@ jobs: create-args: >- python=${{ matrix.python-version }} pip --file requirements.txt - --file tests/requirements.txt + --file requirements-dev.txt --channel conda-forge - name: Install ioos_qc diff --git a/requirements-dev.txt b/requirements-dev.txt index 35c16a46..9df12cb7 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,9 @@ bokeh dask +erddapy flake8 +isort nco numba<0.57 pytest -pytest-flake8>=1.0.4 \ No newline at end of file +pytest-flake8>=1.0.4 # https://github.com/tholo/pytest-flake8/pull/59 \ No newline at end of file diff --git a/tests/requirements.txt b/tests/requirements.txt deleted file mode 100644 index 1e0f58dc..00000000 --- a/tests/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -dask -erddapy -flake8 -isort -pytest -pytest-flake8>=1.0.4 # https://github.com/tholo/pytest-flake8/pull/59 From b8764a68b2a12486e7cd7f2cf590470f0817d056 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Thu, 14 Mar 2024 15:55:49 -0300 Subject: [PATCH 09/10] fix lint --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 9df12cb7..a880f80e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,4 +6,4 @@ isort nco numba<0.57 pytest -pytest-flake8>=1.0.4 # https://github.com/tholo/pytest-flake8/pull/59 \ No newline at end of file +pytest-flake8>=1.0.4 # https://github.com/tholo/pytest-flake8/pull/59 From 84c8017d7826edf22e14b7a9dee0b58d92fcfe15 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Thu, 14 Mar 2024 15:58:03 -0300 Subject: [PATCH 10/10] add py<=311 --- .github/workflows/tests.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2f5544c5..22fdf91f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,14 +10,9 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10"] os: [ubuntu-latest] numba: [true, false] - exclude: - - python-version: "3.11" - numba: true - - python-version: "3.12" - numba: true fail-fast: false steps: