Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/check_changelogs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0

- name: Check zarr-python changelog entries
run: uv run --no-sync python ci/check_changelog_entries.py
run: uvx --from rust-just just check-changelogs

- name: Check zarr-metadata changelog entries
run: uv run --no-sync python ci/check_changelog_entries.py packages/zarr-metadata/changes
run: uvx --from rust-just just check-changelogs packages/zarr-metadata/changes
13 changes: 9 additions & 4 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,17 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- name: Install Hatch
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
version: '1.16.5'
enable-cache: true
python-version: '3.12'
# Pre-build the locked env so the measured `run` below is just pytest, not a
# cold uv sync — keeps the walltime sample clean.
- name: Sync locked benchmark env
run: uv sync --locked --no-default-groups --group test -p 3.12
- name: Run the benchmarks
uses: CodSpeedHQ/action@63f3e98b61959fe67f146a3ff022e4136fe9bb9c # v4.17.6
with:
mode: walltime
run: hatch run test.py3.12-minimal:pytest tests/benchmarks --codspeed
run: uv run --no-sync -p 3.12 pytest tests/benchmarks --codspeed
16 changes: 7 additions & 9 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ jobs:
with:
persist-credentials: false
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- run: uv sync --group docs
# --strict turns warnings into errors, so a docs code block that fails to execute
# at build time (e.g. a non-exec python fence disrupting a later exec="true" block)
# fails CI instead of merging as a silent warning.
- run: uv run mkdocs build --strict
env:
DISABLE_MKDOCS_2_WARNING: "true"
NO_MKDOCS_2_WARNING: "true"
- run: uv run python ci/check_unlinked_types.py
with:
python-version: '3.12'
# `just docs-build` runs `mkdocs build --strict` (warnings are errors, so a
# docs code block that fails to execute at build time fails CI) against the
# locked docs env. check_unlinked_types runs in that same synced env.
- run: uvx --from rust-just just docs-build
- run: uvx --from rust-just just check-doc-links
continue-on-error: true
23 changes: 3 additions & 20 deletions .github/workflows/gpu_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ on:

env:
LD_LIBRARY_PATH: /usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64
# Use the uv from astral-sh/setup-uv instead of hatch's bundled (pyapp) uv.
HATCH_ENV_TYPE_VIRTUAL_UV_PATH: uv

permissions:
contents: read
Expand Down Expand Up @@ -56,28 +54,13 @@ jobs:
echo $PATH
echo $LD_LIBRARY_PATH
nvcc -V
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- name: Install Hatch
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc
with:
version: '1.16.5'
- name: Set Up Hatch Env
env:
HATCH_ENV: gputest.py${{ matrix.python-version }}
run: |
hatch env create "$HATCH_ENV"
hatch env run -e "$HATCH_ENV" list-env
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Run Tests
env:
HATCH_ENV: gputest.py${{ matrix.python-version }}
run: |
hatch env run --env "$HATCH_ENV" run-coverage
run: uvx --from rust-just just gpu

- name: Upload coverage
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
Expand Down
22 changes: 3 additions & 19 deletions .github/workflows/hypothesis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ concurrency:

env:
FORCE_COLOR: 3
# Use the uv from astral-sh/setup-uv instead of hatch's bundled (pyapp) uv.
HATCH_ENV_TYPE_VIRTUAL_UV_PATH: uv

jobs:

Expand Down Expand Up @@ -51,23 +49,11 @@ jobs:
else
echo "HYPOTHESIS_PROFILE=ci" >> $GITHUB_ENV
fi
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- name: Install Hatch
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc
with:
version: '1.16.5'
- name: Set Up Hatch Env
env:
HATCH_ENV: test.py${{ matrix.python-version }}-${{ matrix.dependency-set }}
run: |
hatch env create "$HATCH_ENV"
hatch env run -e "$HATCH_ENV" list-env
enable-cache: true
python-version: ${{ matrix.python-version }}
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
- name: Restore cached hypothesis directory
id: restore-hypothesis-cache
Expand All @@ -81,11 +67,9 @@ jobs:
- name: Run slow Hypothesis tests
if: success()
id: status
env:
HATCH_ENV: test.py${{ matrix.python-version }}-${{ matrix.dependency-set }}
run: |
echo "Using Hypothesis profile: $HYPOTHESIS_PROFILE"
hatch env run --env "$HATCH_ENV" run-hypothesis
uvx --from rust-just just hypothesis

# explicitly save the cache so it gets updated, also do this even if it fails.
- name: Save cached hypothesis directory
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,9 @@ jobs:
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: true
# Fail fast if uv.lock is stale vs pyproject.toml. Every test job installs
# with `uv sync --locked`, so a drifted lock would otherwise only surface
# as a confusing failure there.
- name: Check uv.lock is up to date
run: uv lock --check
- uses: j178/prek-action@bdca6f102f98e2b4c7029491a53dfd366469e33d # v2.0.4
86 changes: 26 additions & 60 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ on:
permissions:
contents: read

env:
# Use the uv from astral-sh/setup-uv; without an explicit path hatch
# bootstraps its own (pyapp) uv, which fails on non-3.12 runners.
HATCH_ENV_TYPE_VIRTUAL_UV_PATH: uv

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand Down Expand Up @@ -60,27 +55,21 @@ jobs:
with:
fetch-depth: 0 # grab all branches and tags
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- name: Install Hatch
run: python -m pip install hatch==1.16.5
- name: Set Up Hatch Env
env:
HATCH_ENV: test.py${{ matrix.python-version }}-${{ matrix.dependency-set }}
run: |
hatch env create "$HATCH_ENV"
hatch env run -e "$HATCH_ENV" list-env
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
# The `just` recipe (see Justfile) runs `uv sync --locked`, so one universal
# uv.lock serves every os/python cell — and it fails if the lock is stale vs
# pyproject.toml (a cross-platform drift gate). setup-uv's python-version
# sets UV_PYTHON so uv picks the right interpreter. CI and local dev invoke
# the identical recipe; `uvx --from rust-just` provides `just` without a
# separate install.
- name: Run Tests
env:
HYPOTHESIS_PROFILE: ci
HATCH_ENV: test.py${{ matrix.python-version }}-${{ matrix.dependency-set }}
run: |
hatch env run --env "$HATCH_ENV" run-coverage
run: uvx --from rust-just just test-${{ matrix.dependency-set }}
- name: Upload coverage
if: ${{ matrix.dependency-set == 'optional' && matrix.os == 'ubuntu-latest' }}
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
Expand Down Expand Up @@ -109,26 +98,16 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- name: Install Hatch
run: python -m pip install hatch==1.16.5
- name: Set Up Hatch Env
env:
HATCH_ENV: ${{ matrix.dependency-set }}
run: |
hatch env create "$HATCH_ENV"
hatch env run -e "$HATCH_ENV" list-env
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
# min_deps and upstream are intentionally unlocked (floor constraints from
# ci/min-deps-constraints.txt; nightly + git mains overlay). The recipe names
# match the matrix values — see the Justfile.
- name: Run Tests
env:
HATCH_ENV: ${{ matrix.dependency-set }}
run: |
hatch env run --env "$HATCH_ENV" run-coverage
run: uvx --from rust-just just ${{ matrix.dependency-set }}
- name: Upload coverage
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
Expand All @@ -144,21 +123,13 @@ jobs:
with:
fetch-depth: 0 # required for hatch version discovery, which is needed for numcodecs.zarr3
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.13'
cache: 'pip'
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- name: Install Hatch
run: python -m pip install hatch==1.16.5
- name: Set Up Hatch Env
run: |
hatch run doctest:pip list
- name: Run Tests
run: |
hatch run doctest:test
with:
enable-cache: true
python-version: '3.13'
- name: Run doctests
run: uvx --from rust-just just doctest

benchmarks:
name: Benchmark smoke test
Expand All @@ -168,18 +139,13 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.13'
cache: 'pip'
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- name: Install Hatch
run: python -m pip install hatch==1.16.5
with:
enable-cache: true
python-version: '3.13'
- name: Run Benchmarks
run: |
hatch env run --env "test.py3.13-minimal" run-benchmark
run: uvx --from rust-just just benchmark

test-complete:
name: Test complete
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ __pycache__/
.Python
env/
.venv/
.venv-min-deps/
build/
develop-eggs/
dist/
Expand Down
Loading
Loading