diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4030e194..87d276cc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,14 +12,10 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.11", "3.12", "3.13", "3.14"] + python-version: ["py311", "py312", "py313", "py314"] # macos-15-large is an intel runner, macos-14 is an arm64 runner platform: [ubuntu-latest, ubuntu-22.04-arm, windows-latest, macos-15-large, macos-14] - defaults: - run: - shell: bash -el {0} - steps: - name: Checkout source uses: actions/checkout@v5 @@ -27,42 +23,18 @@ jobs: submodules: recursive fetch-depth: 0 # required for version resolution - - name: Set up Conda - uses: conda-incubator/setup-miniconda@v3.2.0 + - name: Set up Pixi + uses: prefix-dev/setup-pixi@v0.9.4 with: - channels: conda-forge - miniforge-version: latest - python-version: ${{ matrix.python-version }} - - - name: Install compilers - run: conda install -y c-compiler cxx-compiler - - - name: Install clang - if: matrix.platform == 'macos-15-large' - run: conda install -y 'clang>=12.0.1,<17' - - - name: Show conda environment info - run: | - conda info - conda config --show-sources - conda list --show-channel-urls - - - name: Install numcodecs - run: | - export DISABLE_NUMCODECS_AVX2="" - # TODO: Remove this conditional when pcodec supports Python 3.14 - if [[ "${{ matrix.python-version }}" == "3.14" ]]; then - python -m pip install -v -e .[test,test_extras,msgpack,google_crc32c,crc32c,zfpy] - else - python -m pip install -v -e .[test,test_extras,msgpack,google_crc32c,crc32c,pcodec,zfpy] - fi + pixi-version: v0.62.2 + cache: false + environments: test-${{ matrix.python-version }} - name: List installed packages - run: python -m pip list + run: pixi run -e test-${{ matrix.python-version }} uv pip list - name: Run tests - shell: "bash -l {0}" - run: pytest -v + run: pixi run -e test-${{ matrix.python-version }} run-tests - uses: codecov/codecov-action@v5 with: @@ -89,9 +61,9 @@ jobs: fetch-depth: 0 # required for version resolution - name: Set up Pixi - uses: prefix-dev/setup-pixi@v0.9.0 + uses: prefix-dev/setup-pixi@v0.9.4 with: - pixi-version: v0.49.0 + pixi-version: v0.62.2 cache: false - name: List installed packages diff --git a/pyproject.toml b/pyproject.toml index a47600dc..d0f7bc29 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -259,17 +259,29 @@ conflicts = [ [tool.pixi.workspace] channels = ["conda-forge"] -platforms = ["linux-64", "osx-arm64", "osx-64", "win-64"] +platforms = ["linux-64", "linux-aarch64", "osx-arm64", "osx-64", "win-64"] [tool.pixi.dependencies] -python = "=3.14" -clang = ">=19.1.7,<20" c-compiler = ">=1.9.0,<2" cxx-compiler = ">=1.9.0,<2" uv = "*" +# Python version features +[tool.pixi.feature.py311.dependencies] +python = "3.11.*" + +[tool.pixi.feature.py312.dependencies] +python = "3.12.*" + +[tool.pixi.feature.py313.dependencies] +python = "3.13.*" + +[tool.pixi.feature.py314.dependencies] +python = "3.14.*" + +# Test dependencies [tool.pixi.feature.test.pypi-dependencies] -numcodecs = { path = ".", editable = true, extras = ["test","test_extras","msgpack","zfpy"] } +numcodecs = { path = ".", editable = true, extras = ["test", "test_extras", "msgpack", "zfpy", "pcodec"] } [tool.pixi.feature.test-google-crc32c.pypi-dependencies] numcodecs = { path = ".", editable = true, extras = ["google_crc32c"] } @@ -277,16 +289,21 @@ numcodecs = { path = ".", editable = true, extras = ["google_crc32c"] } [tool.pixi.feature.test-crc32c.pypi-dependencies] numcodecs = { path = ".", editable = true, extras = ["crc32c"] } +# Environments [tool.pixi.environments] -default = { solve-group = "default" } -test = ["test"] -test-crc32c = ["test", "test-crc32c"] -test-google-crc32c = ["test", "test-google-crc32c"] +default = { features = ["py314"], solve-group = "py314" } +test-py311 = { features = ["test", "test-google-crc32c", "py311"], solve-group = "py311" } +test-py312 = { features = ["test", "test-google-crc32c", "py312"], solve-group = "py312" } +test-py313 = { features = ["test", "test-google-crc32c", "py313"], solve-group = "py313" } +test-py314 = { features = ["test", "test-google-crc32c", "py314"], solve-group = "py314" } +test-crc32c = { features = ["test", "test-crc32c", "py314"], solve-group = "py314-crc32c" } +test-google-crc32c = { features = ["test", "test-google-crc32c", "py314"], solve-group = "py314-google-crc32c" } +# Tasks [tool.pixi.tasks] ls-deps-312 = "uv run --group test-zarr-312 uv pip freeze" ls-deps-313 = "uv run --group test-zarr-313 uv pip freeze" -ls-deps-main = "uv run --group test-zarr-main uv pip freeze" +ls-deps-main = "uv run --group test-zarr-main 'uv pip freeze'" test-zarr-312 = "uv run --group test-zarr-312 pytest --cov=numcodecs --cov-report=xml --cov-report=term numcodecs/tests/test_zarr3.py numcodecs/tests/test_zarr3_import.py" test-zarr-313 = "uv run --group test-zarr-313 pytest --cov=numcodecs --cov-report=xml --cov-report=term numcodecs/tests/test_zarr3.py numcodecs/tests/test_zarr3_import.py" test-zarr-main = "uv run --group test-zarr-main pytest --cov=numcodecs --cov-report=xml --cov-report=term numcodecs/tests/test_zarr3.py numcodecs/tests/test_zarr3_import.py"