From fbf586f72f314e62d0af8ef8c15f0fe5e15fdf74 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 3 Oct 2025 15:49:04 +0200 Subject: [PATCH 01/16] Add pixi.toml configuration for environment management - Define workspace with VirtualShip name and pixi-build preview - Configure multiple test environments (py310, py311, py312) - Set up feature environments for docs, typing, and pre-commit - Define pixi tasks for tests, docs, linting, and type checking - Align dependencies with existing pyproject.toml --- pixi.toml | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 pixi.toml diff --git a/pixi.toml b/pixi.toml new file mode 100644 index 000000000..e6d86f158 --- /dev/null +++ b/pixi.toml @@ -0,0 +1,93 @@ +[workspace] +name = "VirtualShip" +preview = ["pixi-build"] +channels = ["conda-forge"] +platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"] + +[package] +name = "virtualship" +version = "dynamic" + +[package.build] +backend = { name = "pixi-build-python", version = "==0.3.2" } + +[package.host-dependencies] +setuptools = "*" +setuptools_scm = "*" + +[environments] +test-latest = { features = ["test"], solve-group = "test" } +test-py310 = { features = ["test", "py310"] } +test-py311 = { features = ["test", "py311"] } +test-py312 = { features = ["test", "py312"] } +test-notebooks = { features = ["test", "notebooks"], solve-group = "test" } +docs = { features = ["docs"], solve-group = "docs" } +typing = { features = ["typing"], solve-group = "typing" } +pre-commit = { features = ["pre-commit"], no-default-feature = true } + +[dependencies] # keep section in sync with pyproject.toml dependencies +python = ">=3.10" +click = "*" +parcels = ">3.1.0" +pyproj = ">=3,<4" +sortedcontainers = "==2.4.0" +opensimplex = "==0.4.5" +numpy = ">=1,<2" +pydantic = ">=2,<3" +pyyaml = "*" +copernicusmarine = ">=2.2.2" +yaspin = "*" +textual = "*" + +[feature.py310.dependencies] +python = "3.10.*" + +[feature.py311.dependencies] +python = "3.11.*" + +[feature.py312.dependencies] +python = "3.12.*" + +[feature.test.dependencies] +pytest = "*" +pytest-cov = "*" +pytest-asyncio = "*" +seabird = "*" +openpyxl = "*" + +[feature.test.tasks] +tests = "pytest -ra --cov --cov-report=xml --cov-report=term --durations=20" + +[feature.notebooks.dependencies] +nbval = "*" +ipykernel = "*" + +[feature.notebooks.tasks] +tests-notebooks = "pytest --nbval-lax docs/" + +[feature.docs.dependencies] +sphinx = ">=7.0" +myst-parser = ">=0.13" +nbsphinx = "*" +ipykernel = "*" +pandoc = "*" +sphinx-copybutton = "*" +pydata-sphinx-theme = "*" +sphinx-autobuild = "*" + +[feature.docs.tasks] +docs = "sphinx-build docs docs/_build" +docs-watch = "sphinx-autobuild docs docs/_build" + +[feature.pre-commit.dependencies] +pre_commit = "*" + +[feature.pre-commit.tasks] +lint = "pre-commit run --all-files" + +[feature.typing.dependencies] +mypy = "*" +lxml = "*" + +[feature.typing.tasks] +typing = "mypy src/virtualship --install-types" From 5d8304bb0d9b24b6bb00a956bc5d5cafa2754450 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 3 Oct 2025 15:50:36 +0200 Subject: [PATCH 02/16] Update CI workflows to use Pixi - Replace mamba-org/setup-micromamba with prefix-dev/setup-pixi - Update test job to use pixi environments (test-py310, test-py312) - Update typechecking job to use pixi run typing - Enable pixi caching for faster CI runs - Simplify workflow by removing manual dependency installation --- .github/workflows/ci.yml | 63 +++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 37 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9e4fdd39..abda125dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,58 +22,47 @@ env: jobs: tests: - name: tests (${{ matrix.runs-on }} | Python ${{ matrix.python-version }}) + name: "Unit tests: ${{ matrix.runs-on }} | pixi run -e ${{ matrix.pixi-environment }} tests" runs-on: ${{ matrix.runs-on }} strategy: fail-fast: false matrix: - python-version: ["3.10", "3.12"] + pixi-environment: ["test-py310", "test-py312"] runs-on: [ubuntu-latest, windows-latest, macos-14] steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: mamba-org/setup-micromamba@v2 + - uses: prefix-dev/setup-pixi@v0.9.0 with: - environment-name: ship - environment-file: environment.yml - create-args: >- - python=${{matrix.python-version}} - - - run: pip install . --no-deps + cache: true + cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} - name: Test package - run: >- - python -m pytest -ra --cov --cov-report=xml --cov-report=term - --durations=20 + run: pixi run -e ${{ matrix.pixi-environment }} tests - name: Upload coverage report uses: codecov/codecov-action@v5.4.0 with: token: ${{ secrets.CODECOV_TOKEN }} - # typechecking: - # name: mypy - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # with: - # fetch-depth: 0 - # - uses: mamba-org/setup-micromamba@v2 - # with: - # environment-name: ship - # environment-file: environment.yml - # create-args: >- - # python=3.12 - - # - run: pip install . --no-deps - # - run: conda install lxml # dep for report generation - # - name: Typechecking - # run: | - # mypy --install-types --non-interactive src/virtualship --html-report mypy-report - # - name: Upload test results - # if: ${{ always() }} # Upload even on mypy error - # uses: actions/upload-artifact@v4 - # with: - # name: Mypy report - # path: mypy-report + typechecking: + name: "TypeChecking: pixi run typing" + runs-on: ubuntu-latest + if: false + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: prefix-dev/setup-pixi@v0.9.0 + with: + cache: true + cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} + - name: Typechecking + run: pixi run typing --non-interactive --html-report mypy-report + - name: Upload test results + if: ${{ always() }} # Upload even on mypy error + uses: actions/upload-artifact@v4 + with: + name: Mypy report + path: mypy-report From 05bc414441499c2d170ad0229a4a8977d0565f3c Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 3 Oct 2025 15:51:23 +0200 Subject: [PATCH 03/16] Update contributing guidelines for Pixi - Replace Conda-based development setup with Pixi - Add comprehensive Pixi workflows section with examples - Document testing, docs, and code quality commands - Include tips for environment management and CI reproduction - Update dependency management instructions to reference pixi.toml --- docs/contributing/index.md | 72 +++++++++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 21 deletions(-) diff --git a/docs/contributing/index.md b/docs/contributing/index.md index 27d6d40c3..171d714e9 100644 --- a/docs/contributing/index.md +++ b/docs/contributing/index.md @@ -8,36 +8,66 @@ We have a design document providing a conceptual overview of VirtualShip. This d ### Development installation -We use `conda` to manage our development installation. Make sure you have `conda` installed by following [the instructions here](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html) and then run the following commands: +```{note} +VirtualShip uses [Pixi](https://pixi.sh) to manage environments and run developer tooling. Pixi is a modern alternative to Conda and also includes other powerful tooling useful for a project like VirtualShip. It is our sole development workflow - we do not offer a Conda development workflow. Give Pixi a try, you won't regret it! +``` + +To get started contributing to VirtualShip: + +**Step 1:** [Install Pixi](https://pixi.sh/latest/). + +**Step 2:** [Fork the repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo#forking-a-repository) + +**Step 3:** Clone your fork and `cd` into the repository. + +**Step 4:** Install the Pixi environment ```bash -conda create -n ship python=3.10 -conda activate ship -conda env update --file environment.yml -pip install -e . --no-deps --no-build-isolation +pixi install ``` -This creates an environment, and installs all the dependencies that you need for development, including: +Now you have a development installation of VirtualShip, as well as a bunch of developer tooling to run tests, check code quality, and build the documentation! Simple as that. + +### Pixi workflows + +You can use the following Pixi commands to run common development tasks. -- core dependencies -- development dependencies (e.g., for testing) -- documentation dependencies +**Testing** -then installs the package in editable mode. +- `pixi run tests` - Run the full test suite using pytest with coverage reporting +- `pixi run tests-notebooks` - Run notebook tests -### Useful commands +**Documentation** -The following commands are useful for local development: +- `pixi run docs` - Build the documentation using Sphinx +- `pixi run docs-watch` - Build and auto-rebuild documentation when files change (useful for live editing) -- `pytest` to run tests -- `pre-commit run --all-files` to run pre-commit checks -- `pre-commit install` (optional) to install pre-commit hooks - - this means that every time you commit, pre-commit checks will run on the files you changed -- `sphinx-autobuild docs docs/_build` to build and serve the documentation -- `sphinx-apidoc -o docs/api/ --module-first --no-toc --force src/virtualship` (optional) to generate the API documentation -- `sphinx-build -b linkcheck docs/ _build/linkcheck` to check for broken links in the documentation +**Code quality** -The running of these commands is useful for local development and quick iteration, but not _vital_ as they will be run automatically in the CI pipeline (`pre-commit` by pre-commit.ci, `pytest` by GitHub Actions, and `sphinx` by ReadTheDocs). +- `pixi run lint` - Run pre-commit hooks on all files (includes formatting, linting, and other code quality checks) +- `pixi run typing` - Run mypy type checking on the codebase + +**Different environments** + +VirtualShip supports testing against different environments (e.g., different Python versions) with different feature sets. In CI we test against these environments, and you can too locally. For example: + +- `pixi run -e test-py310 tests` - Run tests using Python 3.10 +- `pixi run -e test-py311 tests` - Run tests using Python 3.11 +- `pixi run -e test-py312 tests` - Run tests using Python 3.12 + +The name of the workflow on GitHub contains the command you have to run locally to recreate the workflow - making it super easy to reproduce CI failures locally. + +**Typical development workflow** + +1. Make your code changes +2. Run `pixi run lint` to ensure code formatting and style compliance +3. Run `pixi run tests` to verify your changes don't break existing functionality +4. If you've added new features, run `pixi run typing` to check type annotations +5. If you've modified documentation, run `pixi run docs` to build and verify the docs + +```{tip} +You can run `pixi info` to see all available environments and `pixi task list` to see all available tasks across environments. +``` ## For maintainers @@ -52,5 +82,5 @@ The running of these commands is useful for local development and quick iteratio When adding a dependency, make sure to modify the following files where relevant: -- `environment.yml` for core and development dependencies (important for the development environment, and CI) +- `pixi.toml` for core and development dependencies (important for the development environment, and CI) - `pyproject.toml` for core dependencies (important for the pypi package, this should propagate through automatically to `recipe/meta.yml` in the conda-forge feedstock) From a59c0b8a8c3d5dbb140b533b7f6c6bbb5247e0d1 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 3 Oct 2025 15:51:45 +0200 Subject: [PATCH 04/16] Add Pixi badge to README Add Pixi badge to indicate project uses Pixi for environment management --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b30e566ed..f0342cdd2 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ +[![Pixi Badge](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/prefix-dev/pixi/main/assets/badge/v0.json)](https://pixi.sh) [![Anaconda-release](https://anaconda.org/conda-forge/virtualship/badges/version.svg)](https://anaconda.org/conda-forge/virtualship/) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/virtualship) [![DOI](https://zenodo.org/badge/682478059.svg)](https://doi.org/10.5281/zenodo.14013931) From 93b02870b73ffb9a96a8ecea4b0902b9f0febcfc Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 3 Oct 2025 15:52:39 +0200 Subject: [PATCH 05/16] Remove environment.yml Environment management is now handled by pixi.toml. The environment.yml file is no longer needed as all dependencies are defined in pixi.toml. --- environment.yml | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 environment.yml diff --git a/environment.yml b/environment.yml deleted file mode 100644 index e15b21d0f..000000000 --- a/environment.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: ship -channels: - - conda-forge -dependencies: - - click - - parcels >3.1.0 - - pyproj >= 3, < 4 - - sortedcontainers == 2.4.0 - - opensimplex == 0.4.5 - - numpy >=1, < 2 - - pydantic >=2, <3 - - pip - - pyyaml - - copernicusmarine >= 2.2.2 - - openpyxl - - yaspin - - textual - - # linting - - pre-commit - - mypy - - # Testing - - pytest - - pytest-cov - - pytest-asyncio - - codecov - - seabird - - setuptools - - # Docs - - sphinx>=7.0 - - myst-parser>=0.13 - - nbsphinx - - ipykernel - - pandoc - - sphinx-copybutton - # - sphinx-autodoc-typehints # https://github.com/OceanParcels/virtualship/pull/125#issuecomment-2668766302 - - pydata-sphinx-theme - - sphinx-autobuild From 1b6de1269ebc91ebb924246c64074cc594b63679 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Mon, 6 Oct 2025 14:20:49 +0200 Subject: [PATCH 06/16] Add virtualship source dependency --- pixi.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pixi.toml b/pixi.toml index e6d86f158..4b755b408 100644 --- a/pixi.toml +++ b/pixi.toml @@ -6,10 +6,11 @@ platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"] [package] name = "virtualship" -version = "dynamic" +version = "dynamic" # dynamic versioning needs better support in pixi https://github.com/prefix-dev/pixi/issues/2923#issuecomment-2598460666 . Putting `version = "dynamic"` here for now until pixi recommends something else. +license = "MIT" # can remove this once https://github.com/prefix-dev/pixi-build-backends/issues/397 is resolved [package.build] -backend = { name = "pixi-build-python", version = "==0.3.2" } +backend = { name = "pixi-build-python", version = "==0.4.0" } [package.host-dependencies] setuptools = "*" @@ -38,6 +39,7 @@ pyyaml = "*" copernicusmarine = ">=2.2.2" yaspin = "*" textual = "*" +virtualship = { path = "." } [feature.py310.dependencies] python = "3.10.*" From 38bf1ad2534c4b12abd1170b1f473a32b3942df7 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Mon, 6 Oct 2025 14:44:57 +0200 Subject: [PATCH 07/16] Move pytest args to CI call --- .github/workflows/ci.yml | 4 +++- pixi.toml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index abda125dd..2c67cf543 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,9 @@ jobs: cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} - name: Test package - run: pixi run -e ${{ matrix.pixi-environment }} tests + run: + pixi run -e ${{ matrix.pixi-environment }} tests -ra --cov --cov-report=xml --cov-report=term + --durations=20 - name: Upload coverage report uses: codecov/codecov-action@v5.4.0 diff --git a/pixi.toml b/pixi.toml index 4b755b408..8164d2d47 100644 --- a/pixi.toml +++ b/pixi.toml @@ -58,7 +58,7 @@ seabird = "*" openpyxl = "*" [feature.test.tasks] -tests = "pytest -ra --cov --cov-report=xml --cov-report=term --durations=20" +tests = "pytest" [feature.notebooks.dependencies] nbval = "*" From 552cda30f7843a8ba6d993b3292fc74557af3f92 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Mon, 6 Oct 2025 14:46:43 +0200 Subject: [PATCH 08/16] Update RTD config --- .readthedocs.yaml | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 1c13b28aa..a8b751be8 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,18 +1,17 @@ -# Read the Docs configuration file -# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details - version: 2 -sphinx: - configuration: docs/conf.py build: - os: ubuntu-22.04 + os: ubuntu-lts-latest tools: - python: mambaforge-22.9 + python: "latest" # just so RTD stops complaining jobs: - pre_build: - - pip install . - - sphinx-build -b linkcheck docs/ _build/linkcheck - - sphinx-apidoc -o docs/api/ --module-first --no-toc --force src/virtualship - -conda: - environment: environment.yml + create_environment: + - asdf plugin add pixi + - asdf install pixi latest + - asdf global pixi latest + install: + - pixi install -e docs + build: + html: + - pixi run -e docs sphinx-build -T -b html docs $READTHEDOCS_OUTPUT/html +sphinx: + configuration: docs/conf.py From bda868f8de7a555542f5b4aa7365ddf653fc4808 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Thu, 23 Oct 2025 10:12:34 +0200 Subject: [PATCH 09/16] Add caching of Pixi lock --- .github/workflows/ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c67cf543..c43a20a60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,9 +21,13 @@ env: FORCE_COLOR: 3 jobs: + cache-pixi-lock: + uses: Parcels-code/Parcels/.github/workflows/cache-pixi-lock.yml@58cdd6185b3af03785c567914a070288ffd804e0 + tests: name: "Unit tests: ${{ matrix.runs-on }} | pixi run -e ${{ matrix.pixi-environment }} tests" runs-on: ${{ matrix.runs-on }} + needs: cache-pixi-lock strategy: fail-fast: false matrix: @@ -34,6 +38,10 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + - uses: actions/cache/restore@v4 + with: + path: pixi.lock + key: ${{ needs.cache-pixi-lock.outputs.cache-id }} - uses: prefix-dev/setup-pixi@v0.9.0 with: cache: true @@ -52,10 +60,15 @@ jobs: name: "TypeChecking: pixi run typing" runs-on: ubuntu-latest if: false + needs: cache-pixi-lock steps: - uses: actions/checkout@v4 with: fetch-depth: 0 + - uses: actions/cache/restore@v4 + with: + path: pixi.lock + key: ${{ needs.cache-pixi-lock.outputs.cache-id }} - uses: prefix-dev/setup-pixi@v0.9.0 with: cache: true From 8cee3bf3759e3061c3eb38faea2b007eb7b7b16e Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 6 Feb 2026 15:40:40 +0100 Subject: [PATCH 10/16] Pixi git files --- .gitattributes | 2 ++ .gitignore | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..997504b46 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# SCM syntax highlighting & preventing 3-way merges +pixi.lock merge=binary linguist-language=YAML linguist-generated=true -diff diff --git a/.gitignore b/.gitignore index 3af1956fa..242552d3b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ +# pixi environments +.pixi/* +!.pixi/config.toml + + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] From 9703de097357146e83ccfffb9474c533cd85a203 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Mon, 9 Feb 2026 13:15:01 +0100 Subject: [PATCH 11/16] Remove license = key in pixi.toml no longer needed since issue is resolved --- pixi.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pixi.toml b/pixi.toml index 8164d2d47..ad04aa154 100644 --- a/pixi.toml +++ b/pixi.toml @@ -7,7 +7,6 @@ platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"] [package] name = "virtualship" version = "dynamic" # dynamic versioning needs better support in pixi https://github.com/prefix-dev/pixi/issues/2923#issuecomment-2598460666 . Putting `version = "dynamic"` here for now until pixi recommends something else. -license = "MIT" # can remove this once https://github.com/prefix-dev/pixi-build-backends/issues/397 is resolved [package.build] backend = { name = "pixi-build-python", version = "==0.4.0" } From 7cf9fdee47569c6b7d0994921afdd456f386f1a8 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Mon, 9 Feb 2026 13:15:20 +0100 Subject: [PATCH 12/16] Update pixi-build-python backend version --- pixi.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pixi.toml b/pixi.toml index ad04aa154..c3dd82583 100644 --- a/pixi.toml +++ b/pixi.toml @@ -9,7 +9,7 @@ name = "virtualship" version = "dynamic" # dynamic versioning needs better support in pixi https://github.com/prefix-dev/pixi/issues/2923#issuecomment-2598460666 . Putting `version = "dynamic"` here for now until pixi recommends something else. [package.build] -backend = { name = "pixi-build-python", version = "==0.4.0" } +backend = { name = "pixi-build-python", version = "0.4.*" } [package.host-dependencies] setuptools = "*" From 0c955cfff3b21f2346570e60c7bb2eabdd776730 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Mon, 9 Feb 2026 13:56:15 +0100 Subject: [PATCH 13/16] Update workflow to external pixi lock action --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c43a20a60..fb377df9d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,10 +19,24 @@ env: # Many color libraries just need this to be set to any value, but at least # one distinguishes color depth, where "3" -> "256-bit color". FORCE_COLOR: 3 + PIXI_VERSION: "v0.63.2" jobs: cache-pixi-lock: - uses: Parcels-code/Parcels/.github/workflows/cache-pixi-lock.yml@58cdd6185b3af03785c567914a070288ffd804e0 + runs-on: ubuntu-slim + outputs: + cache-key: ${{ steps.pixi-lock.outputs.cache-key }} + pixi-version: ${{ steps.pixi-lock.outputs.pixi-version }} + steps: + - uses: actions/checkout@v4 + - uses: Parcels-code/pixi-lock/create-and-cache@9a2866f8258b87a3c616d5ad7d51c6cd853df78b + id: pixi-lock + with: + pixi-version: ${{env.PIXI_VERSION}} + - uses: actions/upload-artifact@v6 # make available as an artifact for local testing + with: + name: pixi-lock + path: pixi.lock tests: name: "Unit tests: ${{ matrix.runs-on }} | pixi run -e ${{ matrix.pixi-environment }} tests" @@ -33,19 +47,18 @@ jobs: matrix: pixi-environment: ["test-py310", "test-py312"] runs-on: [ubuntu-latest, windows-latest, macos-14] - steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/cache/restore@v4 + - uses: Parcels-code/pixi-lock/restore@9a2866f8258b87a3c616d5ad7d51c6cd853df78b with: - path: pixi.lock - key: ${{ needs.cache-pixi-lock.outputs.cache-id }} - - uses: prefix-dev/setup-pixi@v0.9.0 + cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} + - uses: prefix-dev/setup-pixi@v0.9.4 with: cache: true cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} + pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }} - name: Test package run: @@ -65,13 +78,13 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/cache/restore@v4 + - uses: Parcels-code/pixi-lock/restore@9a2866f8258b87a3c616d5ad7d51c6cd853df78b with: - path: pixi.lock - key: ${{ needs.cache-pixi-lock.outputs.cache-id }} - - uses: prefix-dev/setup-pixi@v0.9.0 + cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} + - uses: prefix-dev/setup-pixi@v0.9.4 with: cache: true + pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }} cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} - name: Typechecking run: pixi run typing --non-interactive --html-report mypy-report From 0c59afa3f37d81519fa32775e2df8f77cbf3c3d0 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Mon, 9 Feb 2026 14:02:47 +0100 Subject: [PATCH 14/16] Update default environment for Pixi --- pixi.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pixi.toml b/pixi.toml index c3dd82583..0719ebf7f 100644 --- a/pixi.toml +++ b/pixi.toml @@ -16,6 +16,7 @@ setuptools = "*" setuptools_scm = "*" [environments] +default = { features = ["test", "notebooks", "typing", "pre-commit"] } test-latest = { features = ["test"], solve-group = "test" } test-py310 = { features = ["test", "py310"] } test-py311 = { features = ["test", "py311"] } From b0b1ad36c305442027174b1d1d86efe8c899acbc Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Mon, 9 Feb 2026 14:04:08 +0100 Subject: [PATCH 15/16] Refactor pixi manifest to use run-dependencies --- pixi.toml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/pixi.toml b/pixi.toml index 0719ebf7f..21df8c245 100644 --- a/pixi.toml +++ b/pixi.toml @@ -15,18 +15,7 @@ backend = { name = "pixi-build-python", version = "0.4.*" } setuptools = "*" setuptools_scm = "*" -[environments] -default = { features = ["test", "notebooks", "typing", "pre-commit"] } -test-latest = { features = ["test"], solve-group = "test" } -test-py310 = { features = ["test", "py310"] } -test-py311 = { features = ["test", "py311"] } -test-py312 = { features = ["test", "py312"] } -test-notebooks = { features = ["test", "notebooks"], solve-group = "test" } -docs = { features = ["docs"], solve-group = "docs" } -typing = { features = ["typing"], solve-group = "typing" } -pre-commit = { features = ["pre-commit"], no-default-feature = true } - -[dependencies] # keep section in sync with pyproject.toml dependencies +[package.run-dependencies] # Keep in sync with `pyproject.toml` and feedstock recipe python = ">=3.10" click = "*" parcels = ">3.1.0" @@ -39,6 +28,19 @@ pyyaml = "*" copernicusmarine = ">=2.2.2" yaspin = "*" textual = "*" + +[environments] +default = { features = ["test", "notebooks", "typing", "pre-commit"] } +test-latest = { features = ["test"], solve-group = "test" } +test-py310 = { features = ["test", "py310"] } +test-py311 = { features = ["test", "py311"] } +test-py312 = { features = ["test", "py312"] } +test-notebooks = { features = ["test", "notebooks"], solve-group = "test" } +docs = { features = ["docs"], solve-group = "docs" } +typing = { features = ["typing"], solve-group = "typing" } +pre-commit = { features = ["pre-commit"], no-default-feature = true } + +[dependencies] virtualship = { path = "." } [feature.py310.dependencies] From 921fe1ba0fcb84e2be0e25c0a348a786ab4fd0fe Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Mon, 9 Feb 2026 14:05:45 +0100 Subject: [PATCH 16/16] Move environment definitions to the end of the file --- pixi.toml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pixi.toml b/pixi.toml index 21df8c245..d73f8c856 100644 --- a/pixi.toml +++ b/pixi.toml @@ -29,17 +29,6 @@ copernicusmarine = ">=2.2.2" yaspin = "*" textual = "*" -[environments] -default = { features = ["test", "notebooks", "typing", "pre-commit"] } -test-latest = { features = ["test"], solve-group = "test" } -test-py310 = { features = ["test", "py310"] } -test-py311 = { features = ["test", "py311"] } -test-py312 = { features = ["test", "py312"] } -test-notebooks = { features = ["test", "notebooks"], solve-group = "test" } -docs = { features = ["docs"], solve-group = "docs" } -typing = { features = ["typing"], solve-group = "typing" } -pre-commit = { features = ["pre-commit"], no-default-feature = true } - [dependencies] virtualship = { path = "." } @@ -95,3 +84,14 @@ lxml = "*" [feature.typing.tasks] typing = "mypy src/virtualship --install-types" + +[environments] +default = { features = ["test", "notebooks", "typing", "pre-commit"] } +test-latest = { features = ["test"], solve-group = "test" } +test-py310 = { features = ["test", "py310"] } +test-py311 = { features = ["test", "py311"] } +test-py312 = { features = ["test", "py312"] } +test-notebooks = { features = ["test", "notebooks"], solve-group = "test" } +docs = { features = ["docs"], solve-group = "docs" } +typing = { features = ["typing"], solve-group = "typing" } +pre-commit = { features = ["pre-commit"], no-default-feature = true }