From 2a9fc23b8bc158e87ba69d885fa909dcaf8d24c9 Mon Sep 17 00:00:00 2001 From: Huite Bootsma Date: Mon, 4 Dec 2023 13:46:17 +0100 Subject: [PATCH 1/7] WIP: Run multiple Python versions during tests --- .github/workflows/ci.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5618a489..07b68bb08 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,17 @@ jobs: uses: actions/checkout@v2 - name: Setup Pixi uses: prefix-dev/setup-pixi@v0.3.0 - - name: Run Tests + - name: install py3.9 + run: pixi add python=3.9 + - name: Run Tests 3.9 + run: pixi run test + - name: install py3.10 + run: pixi add python=3.10 + - name: Run Tests 3.10 + run: pixi run test + - name: install py3.11 + run: pixi add python=3.11 + - name: Run Tests 3.11 run: pixi run test - name: Publish Code Coverage uses: codecov/codecov-action@v3 From 16d563c4f1114c8e8f0a73bec9db2a0766d89b33 Mon Sep 17 00:00:00 2001 From: Huite Bootsma Date: Mon, 4 Dec 2023 13:52:15 +0100 Subject: [PATCH 2/7] Separate Python version tests --- .github/workflows/ci-py3_10.yml | 32 ++++++++++++++++++++++++++++++++ .github/workflows/ci-py3_9.yml | 32 ++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 12 +----------- 3 files changed, 65 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/ci-py3_10.yml create mode 100644 .github/workflows/ci-py3_9.yml diff --git a/.github/workflows/ci-py3_10.yml b/.github/workflows/ci-py3_10.yml new file mode 100644 index 000000000..2df3caacd --- /dev/null +++ b/.github/workflows/ci-py3_10.yml @@ -0,0 +1,32 @@ +name: test-py3.10 + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Check out repo + uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + - name: Run pre-commit + uses: pre-commit/action@v2.0.3 + + build: + runs-on: ubuntu-latest + steps: + - name: Check out repo + uses: actions/checkout@v2 + - name: Setup Pixi + uses: prefix-dev/setup-pixi@v0.3.0 + - name: install py3.10 + run: pixi add python=3.10 + - name: Run Tests 3.10 + run: pixi run test \ No newline at end of file diff --git a/.github/workflows/ci-py3_9.yml b/.github/workflows/ci-py3_9.yml new file mode 100644 index 000000000..f96d996ef --- /dev/null +++ b/.github/workflows/ci-py3_9.yml @@ -0,0 +1,32 @@ +name: test-py3.9 + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Check out repo + uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + - name: Run pre-commit + uses: pre-commit/action@v2.0.3 + + build: + runs-on: ubuntu-latest + steps: + - name: Check out repo + uses: actions/checkout@v2 + - name: Setup Pixi + uses: prefix-dev/setup-pixi@v0.3.0 + - name: install py3.9 + run: pixi add python=3.9 + - name: Run Tests 3.9 + run: pixi run test \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07b68bb08..a5618a489 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,17 +26,7 @@ jobs: uses: actions/checkout@v2 - name: Setup Pixi uses: prefix-dev/setup-pixi@v0.3.0 - - name: install py3.9 - run: pixi add python=3.9 - - name: Run Tests 3.9 - run: pixi run test - - name: install py3.10 - run: pixi add python=3.10 - - name: Run Tests 3.10 - run: pixi run test - - name: install py3.11 - run: pixi add python=3.11 - - name: Run Tests 3.11 + - name: Run Tests run: pixi run test - name: Publish Code Coverage uses: codecov/codecov-action@v3 From 42640a0746c42791efcd0c844782abf3e7a783e3 Mon Sep 17 00:00:00 2001 From: Huite Bootsma Date: Mon, 4 Dec 2023 14:19:01 +0100 Subject: [PATCH 3/7] Try matrix.python-version --- .github/workflows/ci-py3_10.yml | 32 -------------------------------- .github/workflows/ci-py3_9.yml | 32 -------------------------------- .github/workflows/ci.yml | 12 ++++++++++++ 3 files changed, 12 insertions(+), 64 deletions(-) delete mode 100644 .github/workflows/ci-py3_10.yml delete mode 100644 .github/workflows/ci-py3_9.yml diff --git a/.github/workflows/ci-py3_10.yml b/.github/workflows/ci-py3_10.yml deleted file mode 100644 index 2df3caacd..000000000 --- a/.github/workflows/ci-py3_10.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: test-py3.10 - -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - name: Check out repo - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - - name: Run pre-commit - uses: pre-commit/action@v2.0.3 - - build: - runs-on: ubuntu-latest - steps: - - name: Check out repo - uses: actions/checkout@v2 - - name: Setup Pixi - uses: prefix-dev/setup-pixi@v0.3.0 - - name: install py3.10 - run: pixi add python=3.10 - - name: Run Tests 3.10 - run: pixi run test \ No newline at end of file diff --git a/.github/workflows/ci-py3_9.yml b/.github/workflows/ci-py3_9.yml deleted file mode 100644 index f96d996ef..000000000 --- a/.github/workflows/ci-py3_9.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: test-py3.9 - -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - name: Check out repo - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - - name: Run pre-commit - uses: pre-commit/action@v2.0.3 - - build: - runs-on: ubuntu-latest - steps: - - name: Check out repo - uses: actions/checkout@v2 - - name: Setup Pixi - uses: prefix-dev/setup-pixi@v0.3.0 - - name: install py3.9 - run: pixi add python=3.9 - - name: Run Tests 3.9 - run: pixi run test \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5618a489..f1c3593e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,12 @@ on: jobs: lint: runs-on: ubuntu-latest + strategy: + matrix: + python-version: + - "3.9" + - "3.10" + - "3.11" steps: - name: Check out repo uses: actions/checkout@v2 @@ -26,14 +32,20 @@ jobs: uses: actions/checkout@v2 - name: Setup Pixi uses: prefix-dev/setup-pixi@v0.3.0 + - name: Setup older Python versions + if: ${{ matrix.python-version }} != "3.11" + uses: pixi add python=${{ matrix.python-version}} - name: Run Tests run: pixi run test - name: Publish Code Coverage + if: ${{ matrix.python-version }} == "3.11" uses: codecov/codecov-action@v3 - name: Build Docs + if: ${{ matrix.python-version }} == "3.11" run: pixi run docs - name: Deploy to Github Pages uses: peaceiris/actions-gh-pages@v3 + if: ${{ matrix.python-version }} == "3.11" with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./docs/_build From 52e38a46d76cf9256995fdebdb0aa2b7e241c904 Mon Sep 17 00:00:00 2001 From: Huite Bootsma Date: Mon, 4 Dec 2023 14:19:18 +0100 Subject: [PATCH 4/7] import future annotations --- xugrid/ugrid/interpolate.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xugrid/ugrid/interpolate.py b/xugrid/ugrid/interpolate.py index d6ea05944..c29602d17 100644 --- a/xugrid/ugrid/interpolate.py +++ b/xugrid/ugrid/interpolate.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import warnings import numpy as np From de36e2b0c6271aa92cd801a758ca32909aea74a5 Mon Sep 17 00:00:00 2001 From: Huite Bootsma Date: Mon, 4 Dec 2023 14:20:41 +0100 Subject: [PATCH 5/7] strategy in the right section... --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f1c3593e1..339e97500 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,12 +11,6 @@ on: jobs: lint: runs-on: ubuntu-latest - strategy: - matrix: - python-version: - - "3.9" - - "3.10" - - "3.11" steps: - name: Check out repo uses: actions/checkout@v2 @@ -27,6 +21,12 @@ jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + python-version: + - "3.9" + - "3.10" + - "3.11" steps: - name: Check out repo uses: actions/checkout@v2 From 3d766869aa180406ee03bf1e2d61b3a3e7d38802 Mon Sep 17 00:00:00 2001 From: Huite Bootsma Date: Mon, 4 Dec 2023 14:22:10 +0100 Subject: [PATCH 6/7] run versus uses --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 339e97500..7e827c768 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: uses: prefix-dev/setup-pixi@v0.3.0 - name: Setup older Python versions if: ${{ matrix.python-version }} != "3.11" - uses: pixi add python=${{ matrix.python-version}} + run: pixi add python=${{ matrix.python-version }} - name: Run Tests run: pixi run test - name: Publish Code Coverage From 7d78a8e0c630e7a21bedd506a2108d1a6e92ebb2 Mon Sep 17 00:00:00 2001 From: Huite Bootsma Date: Mon, 4 Dec 2023 14:39:33 +0100 Subject: [PATCH 7/7] More explicit version, no if --- .github/workflows/ci.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7e827c768..ab984542f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,34 +18,39 @@ jobs: uses: actions/setup-python@v2 - name: Run pre-commit uses: pre-commit/action@v2.0.3 - - build: + + test: runs-on: ubuntu-latest strategy: matrix: python-version: - "3.9" - "3.10" - - "3.11" steps: - name: Check out repo uses: actions/checkout@v2 - name: Setup Pixi uses: prefix-dev/setup-pixi@v0.3.0 - name: Setup older Python versions - if: ${{ matrix.python-version }} != "3.11" run: pixi add python=${{ matrix.python-version }} - name: Run Tests run: pixi run test + + build: + runs-on: ubuntu-latest + steps: + - name: Check out repo + uses: actions/checkout@v2 + - name: Setup Pixi + uses: prefix-dev/setup-pixi@v0.3.0 + - name: Run Tests + run: pixi run test - name: Publish Code Coverage - if: ${{ matrix.python-version }} == "3.11" uses: codecov/codecov-action@v3 - name: Build Docs - if: ${{ matrix.python-version }} == "3.11" run: pixi run docs - name: Deploy to Github Pages uses: peaceiris/actions-gh-pages@v3 - if: ${{ matrix.python-version }} == "3.11" with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./docs/_build