From 132b3c48bfa40b795df1c6fafc45e77aa24d3992 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Tue, 10 Feb 2026 16:59:12 +0100 Subject: [PATCH 01/12] Rename github actions job --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 52d80e0050..8b6cf6ebf9 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -8,7 +8,7 @@ permissions: id-token: write jobs: - build: + build-nightly-parcels: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 From bc9799b0ae86fa225b6f08afb1f296c18da3658a Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Tue, 10 Feb 2026 17:00:25 +0100 Subject: [PATCH 02/12] Move permissions block --- .github/workflows/nightly.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 8b6cf6ebf9..341ce50e57 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -3,12 +3,11 @@ name: Publish alpha version of Parcels on: workflow_dispatch: -permissions: - contents: read - id-token: write - jobs: build-nightly-parcels: + permissions: + contents: read + id-token: write runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 From 5dfc7a0b79c9dc9e4b5b151bbbf35757c125cf73 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Tue, 10 Feb 2026 17:02:42 +0100 Subject: [PATCH 03/12] Move workflow job --- .github/workflows/ci.yml | 19 +++++++++++++++++++ .github/workflows/nightly.yml | 25 ------------------------- 2 files changed, 19 insertions(+), 25 deletions(-) delete mode 100644 .github/workflows/nightly.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 26456e22f5..7fa10b7077 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,7 @@ on: push: branches: - "main" + - "v4-dev" - "test-me/*" pull_request: schedule: @@ -195,3 +196,21 @@ jobs: with: name: Mypy report path: mypy-report + build-and-upload-nightly-parcels: # for alpha testing + permissions: + contents: read + id-token: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - name: Build conda package + uses: prefix-dev/rattler-build-action@v0.2.34 + with: + recipe-path: .github/ci/recipe.yaml + - run: | + for pkg in $(find output -type f \( -name "*.conda" -o -name "*.tar.bz2" \) ); do + echo "Uploading ${pkg}" + rattler-build upload prefix -c parcels "${pkg}" + done + env: + PREFIX_API_KEY: ${{ secrets.PREFIX_API_KEY }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml deleted file mode 100644 index 341ce50e57..0000000000 --- a/.github/workflows/nightly.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Publish alpha version of Parcels - -on: - workflow_dispatch: - -jobs: - build-nightly-parcels: - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v5 - - name: Build conda package - uses: prefix-dev/rattler-build-action@v0.2.34 - with: - recipe-path: .github/ci/recipe.yaml - - - run: | - for pkg in $(find output -type f \( -name "*.conda" -o -name "*.tar.bz2" \) ); do - echo "Uploading ${pkg}" - rattler-build upload prefix -c parcels "${pkg}" - done - env: - PREFIX_API_KEY: ${{ secrets.PREFIX_API_KEY }} From 244c189db8ba808df6af11282401f3a0734eceb4 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Tue, 10 Feb 2026 17:05:57 +0100 Subject: [PATCH 04/12] Isolate upload step to v4-dev branch --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7fa10b7077..cbb7dd0a4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -207,7 +207,8 @@ jobs: uses: prefix-dev/rattler-build-action@v0.2.34 with: recipe-path: .github/ci/recipe.yaml - - run: | + - if: github.ref == 'refs/heads/v4-dev' + run: | for pkg in $(find output -type f \( -name "*.conda" -o -name "*.tar.bz2" \) ); do echo "Uploading ${pkg}" rattler-build upload prefix -c parcels "${pkg}" From 3c0799ef54407cff995779b3f3bd29a89c51fa61 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Tue, 10 Feb 2026 17:06:17 +0100 Subject: [PATCH 05/12] Remove cron schedule for ci.yml --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cbb7dd0a4b..dad2a07b8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,8 +6,6 @@ on: - "v4-dev" - "test-me/*" pull_request: - schedule: - - cron: "0 7 * * 1" # Run every Monday at 7:00 UTC concurrency: group: branch-${{ github.head_ref }} From bff545bfb4147296efa41469fbfb4025d736c8dd Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Tue, 10 Feb 2026 17:37:37 +0100 Subject: [PATCH 06/12] Automatically determine alpha number --- .github/ci/recipe.yaml | 2 +- .github/workflows/ci.yml | 11 +++++++++++ pixi.toml | 3 +++ tools/get-parcels-alpha-version.py | 30 ++++++++++++++++++++++++++++++ 4 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 tools/get-parcels-alpha-version.py diff --git a/.github/ci/recipe.yaml b/.github/ci/recipe.yaml index 96962b8bac..8bcd6c78ca 100644 --- a/.github/ci/recipe.yaml +++ b/.github/ci/recipe.yaml @@ -4,7 +4,7 @@ # Adapted from the conda forge recipe context: name: parcels - version: 4.0.0alpha2 # The last number here needs to be bumped for each new alpha release + version: ${{ env['PARCELS_ALPHA_VERSION'] }} package: name: ${{ name|lower }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dad2a07b8b..27b485c950 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -195,12 +195,23 @@ jobs: name: Mypy report path: mypy-report build-and-upload-nightly-parcels: # for alpha testing + needs: [cache-pixi-lock] permissions: contents: read id-token: write runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 + - name: Restore cached pixi lockfile + uses: Parcels-code/pixi-lock/restore@2b823a4a804631370fbde7e6088ee5db71a26c60 # TODO: Update to action in prefix-dev once available + with: + cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} + - uses: prefix-dev/setup-pixi@v0.9.0 + with: + pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }} + cache: true + cache-write: ${{ github.event_name == 'push' && github.ref_name == 'v4-dev' }} # TODO: Update v4-dev to main when v4 is released + - run: pixi run get-parcels-alpha-version >> $GITHUB_ENV - name: Build conda package uses: prefix-dev/rattler-build-action@v0.2.34 with: diff --git a/pixi.toml b/pixi.toml index 4dcbd65750..70cad62fb5 100644 --- a/pixi.toml +++ b/pixi.toml @@ -35,6 +35,9 @@ py-triangle = ">=20250106,<20250107" [dependencies] parcels = { path = "." } +[tasks] +get-parcels-alpha-version = { cmd = "python tools/get-parcels-alpha-version.py", default-environment = "default" } + [feature.minimum.dependencies] python = "3.11.*" netcdf4 = "1.6.*" diff --git a/tools/get-parcels-alpha-version.py b/tools/get-parcels-alpha-version.py new file mode 100644 index 0000000000..a1438f91a2 --- /dev/null +++ b/tools/get-parcels-alpha-version.py @@ -0,0 +1,30 @@ +"""Get a Parcels v4 alpha version string based on commits since the last tag. + +Sets the PARCELS_ALPHA_VERSION environment variable (via GITHUB_ENV in CI, +or prints the version to stdout for local use). +""" + +import subprocess + + +def get_alpha_version(): + result = subprocess.run( + ["git", "describe", "--tags", "--long"], + capture_output=True, + text=True, + check=True, + ) + # Format: --g + # e.g. v3.1.2-1967-g1857d5219 + parts = result.stdout.strip().rsplit("-", 2) + n_commits = parts[1] + return f"4.0.0alpha{n_commits}" + + +def main(): + version = get_alpha_version() + print(f"PARCELS_ALPHA_VERSION={version}") + + +if __name__ == "__main__": + main() From 88c01f007aa300d8864c9a43b4c46a655a2a5a20 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Wed, 11 Feb 2026 11:47:00 +0100 Subject: [PATCH 07/12] Add git to environment with get-parcels-alpha-version --- pixi.toml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pixi.toml b/pixi.toml index 70cad62fb5..71ddfe96ed 100644 --- a/pixi.toml +++ b/pixi.toml @@ -35,8 +35,11 @@ py-triangle = ">=20250106,<20250107" [dependencies] parcels = { path = "." } -[tasks] -get-parcels-alpha-version = { cmd = "python tools/get-parcels-alpha-version.py", default-environment = "default" } +[feature.alpha-parcels.dependencies] +git = "*" + +[feature.alpha-parcels.tasks] +get-parcels-alpha-version = { cmd = "python tools/get-parcels-alpha-version.py" } [feature.minimum.dependencies] python = "3.11.*" @@ -130,3 +133,4 @@ test-py313 = { features = ["test", "py313"] } test-notebooks = { features = ["test", "notebooks"], solve-group = "main" } docs = { features = ["docs", "notebooks"], solve-group = "docs" } typing = { features = ["typing"], solve-group = "main" } +alpha-parcels = { features = ["alpha-parcels"] } From 9aa2d76cb7e7f96ce2892d0dd2eceac137cd10ad Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Wed, 11 Feb 2026 12:18:01 +0100 Subject: [PATCH 08/12] Adjust fetch depth during checkout --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 27b485c950..f56f48e5b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -202,6 +202,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 + with: + fetch-depth: 0 - name: Restore cached pixi lockfile uses: Parcels-code/pixi-lock/restore@2b823a4a804631370fbde7e6088ee5db71a26c60 # TODO: Update to action in prefix-dev once available with: From ae09fd14e283845be9d1f9cad52a22c3dbdddf98 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Wed, 11 Feb 2026 13:09:55 +0100 Subject: [PATCH 09/12] Bump cache-pixi-lock resources --- .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 f56f48e5b0..57474c755e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: exit 1 cache-pixi-lock: - runs-on: ubuntu-slim + runs-on: ubuntu-latest needs: [should-run-ci] outputs: cache-key: ${{ steps.pixi-lock.outputs.cache-key }} From b2a331fb4f4152a34c88e35427818353531b90eb Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Wed, 11 Feb 2026 13:35:06 +0100 Subject: [PATCH 10/12] debug statement --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 57474c755e..459f3faa84 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -214,6 +214,7 @@ jobs: cache: true cache-write: ${{ github.event_name == 'push' && github.ref_name == 'v4-dev' }} # TODO: Update v4-dev to main when v4 is released - run: pixi run get-parcels-alpha-version >> $GITHUB_ENV + - run: echo "PARCELS_ALPHA_VERSION is $PARCELS_ALPHA_VERSION" - name: Build conda package uses: prefix-dev/rattler-build-action@v0.2.34 with: From 0c1dbb9a7a432636bdb9f7e2f66f088e8e375bdc Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Wed, 11 Feb 2026 13:40:32 +0100 Subject: [PATCH 11/12] Fix recipe --- .github/ci/recipe.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ci/recipe.yaml b/.github/ci/recipe.yaml index 8bcd6c78ca..0579c19e42 100644 --- a/.github/ci/recipe.yaml +++ b/.github/ci/recipe.yaml @@ -4,7 +4,7 @@ # Adapted from the conda forge recipe context: name: parcels - version: ${{ env['PARCELS_ALPHA_VERSION'] }} + version: ${{ env.get('PARCELS_ALPHA_VERSION') }} package: name: ${{ name|lower }} From b4778dda8208f7333aad61e0630c10a9f0c4df55 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Wed, 11 Feb 2026 13:57:50 +0100 Subject: [PATCH 12/12] Remove pytest from pyproject.toml The conda build process correctly flagged this. This isn't meant to be in our core dependencies. --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ec55086064..392cd8a2c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,6 @@ dependencies = [ "netCDF4 >=1.7.2", "zarr >=2.15.0,!=2.18.0,<3", "tqdm >=4.50.0", - "pytest", "xarray >=2024.5.0", "uxarray >=2025.3.0", "pooch >=1.8.0",