Skip to content

Commit b2e3c99

Browse files
committed
Merge branch 'fix/zero-length-single-invariant' (zarr-developers#4334) into fix/mixed-regular-chunk-grid-4374
# Conflicts: # src/zarr/core/metadata/v3.py
2 parents e324baa + 2bf32df commit b2e3c99

138 files changed

Lines changed: 4632 additions & 1337 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitattributes‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
*.py linguist-language=python
22
*.ipynb linguist-documentation
33
.git_archival.txt export-subst
4+
5+
# just refuses to format a CRLF file, so `just just-check` would fail on a Windows
6+
# checkout with core.autocrlf=true before the contributor has changed anything.
7+
Justfile text eol=lf
8+
*/justfile text eol=lf
9+
packages/*/justfile text eol=lf

‎.github/workflows/check_changelogs.yml‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,20 @@ jobs:
2424
- name: Install uv
2525
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
2626

27+
- name: Install just
28+
uses: extractions/setup-crate@7577c1bdf2d95e6d65d532788f35ed79d4b1dda2 # v2.0.1
29+
with:
30+
repo: casey/just
31+
version: 1.58.0
32+
2733
- name: Check zarr-python changelog entries
28-
run: uv run --no-sync python ci/check_changelog_entries.py
34+
run: just check-changelogs
2935

3036
- name: Check zarr-metadata changelog entries
31-
run: uv run --no-sync python ci/check_changelog_entries.py packages/zarr-metadata/changes
37+
run: just check-changelogs packages/zarr-metadata/changes
3238

3339
- name: Check zarr-indexing changelog entries
34-
run: uv run --no-sync python ci/check_changelog_entries.py packages/zarr-indexing/changes
40+
run: just check-changelogs packages/zarr-indexing/changes
3541

3642
- name: Check zarr-http-server changelog entries
37-
run: uv run --no-sync python ci/check_changelog_entries.py packages/zarr-http-server/changes
43+
run: just check-changelogs packages/zarr-http-server/changes

‎.github/workflows/codspeed.yml‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,19 @@ jobs:
3131
uses: pypa/hatch@f647ed70d49adb885f53a27d1c7f5bdaeacf2c60
3232
with:
3333
version: '1.16.5'
34+
# No interpreter is set up in this job on purpose. Benchmarks are only comparable
35+
# across runs if the interpreter underneath them does not move: adding a pinned
36+
# Python here measured a uniform ~13% slowdown on every benchmark, because hatch
37+
# then built the environment on that interpreter instead of the runner's own.
38+
- name: Install just
39+
uses: extractions/setup-crate@7577c1bdf2d95e6d65d532788f35ed79d4b1dda2 # v2.0.1
40+
with:
41+
repo: casey/just
42+
version: 1.58.0
3443
- name: Run the benchmarks
3544
uses: CodSpeedHQ/action@373d6868929f444bc08d901fd0eb0ad52a8875ea # v5.2.1
3645
env:
3746
ZARR_BENCHMARK_CLEAR_CACHE: '1'
3847
with:
3948
mode: walltime
40-
run: hatch run test.py3.12-minimal:pytest tests/benchmarks --codspeed
49+
run: HATCH_ENV=test.py3.12-minimal just benchmark-codspeed

‎.github/workflows/docs.yml‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,22 @@ jobs:
2323
with:
2424
persist-credentials: false
2525
- uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
26-
- run: uv sync --group docs
26+
- name: Install just
27+
uses: extractions/setup-crate@7577c1bdf2d95e6d65d532788f35ed79d4b1dda2 # v2.0.1
28+
with:
29+
repo: casey/just
30+
version: 1.58.0
2731
# Fast source-level guards that need no built site, so they run before the (slower)
2832
# build for a quick failure: every public export is in the API reference, and no
2933
# docstring/Markdown carries reStructuredText markup that MkDocs won't render.
30-
- run: uv run python ci/check_documented_exports.py docs/api
31-
- run: uv run python ci/lint_docs.py
34+
- run: just check-doc-exports
35+
- run: just lint-docs
3236
# --strict turns warnings into errors, so a docs code block that fails to execute
3337
# at build time (e.g. a non-exec python fence disrupting a later exec="true" block)
3438
# fails CI instead of merging as a silent warning.
35-
- run: uv run mkdocs build --strict
39+
- run: just docs-build
3640
env:
3741
DISABLE_MKDOCS_2_WARNING: "true"
3842
NO_MKDOCS_2_WARNING: "true"
39-
- run: uv run python ci/check_unlinked_types.py
43+
- run: just check-doc-links
4044
continue-on-error: true

‎.github/workflows/gpu_test.yml‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,27 @@ jobs:
6767
uses: pypa/hatch@f647ed70d49adb885f53a27d1c7f5bdaeacf2c60
6868
with:
6969
version: '1.16.5'
70+
- name: Install just
71+
uses: extractions/setup-crate@7577c1bdf2d95e6d65d532788f35ed79d4b1dda2 # v2.0.1
72+
with:
73+
repo: casey/just
74+
version: 1.58.0
75+
# Two names for the same environment on purpose: `just setup` builds whatever
76+
# HATCH_ENV points at, while `just gpu` reads GPU_HATCH_ENV so that an
77+
# ambient HATCH_ENV can never redirect `pytest -m gpu` into a CPU environment.
7078
- name: Set Up Hatch Env
7179
env:
7280
HATCH_ENV: gputest.py${{ matrix.python-version }}
7381
run: |
74-
hatch env create "$HATCH_ENV"
75-
hatch env run -e "$HATCH_ENV" list-env
82+
just setup
7683
- name: Run Tests
7784
env:
78-
HATCH_ENV: gputest.py${{ matrix.python-version }}
85+
GPU_HATCH_ENV: gputest.py${{ matrix.python-version }}
7986
run: |
80-
hatch env run --env "$HATCH_ENV" run-coverage
87+
just gpu
8188
8289
- name: Upload coverage
83-
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
90+
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
8491
with:
8592
token: ${{ secrets.CODECOV_TOKEN }}
8693
flags: gpu

‎.github/workflows/hypothesis.yaml‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,16 @@ jobs:
6565
uses: pypa/hatch@f647ed70d49adb885f53a27d1c7f5bdaeacf2c60
6666
with:
6767
version: '1.16.5'
68+
- name: Install just
69+
uses: extractions/setup-crate@7577c1bdf2d95e6d65d532788f35ed79d4b1dda2 # v2.0.1
70+
with:
71+
repo: casey/just
72+
version: 1.58.0
6873
- name: Set Up Hatch Env
6974
env:
7075
HATCH_ENV: test.py${{ matrix.python-version }}-${{ matrix.dependency-set }}
7176
run: |
72-
hatch env create "$HATCH_ENV"
73-
hatch env run -e "$HATCH_ENV" list-env
77+
just setup
7478
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
7579
- name: Restore cached hypothesis directory
7680
id: restore-hypothesis-cache
@@ -89,7 +93,7 @@ jobs:
8993
PYTEST_ADDOPTS: "--report-log=output-${{ matrix.python-version }}-log.jsonl"
9094
run: |
9195
echo "Using Hypothesis profile: $HYPOTHESIS_PROFILE"
92-
hatch env run --env "$HATCH_ENV" run-hypothesis
96+
just hypothesis
9397
9498
# explicitly save the cache so it gets updated, also do this even if it fails.
9599
- name: Save cached hypothesis directory
@@ -101,7 +105,7 @@ jobs:
101105
key: cache-hypothesis-${{ runner.os }}-${{ github.run_id }}
102106

103107
- name: Upload coverage
104-
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
108+
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
105109
with:
106110
token: ${{ secrets.CODECOV_TOKEN }}
107111
flags: tests

‎.github/workflows/lint.yml‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,26 @@ jobs:
3030
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
3131
with:
3232
enable-cache: true
33-
- uses: j178/prek-action@4e14d07f9231acabce116ccfca13b13dd9755ece # v3.0.0
33+
- name: Install just
34+
uses: extractions/setup-crate@7577c1bdf2d95e6d65d532788f35ed79d4b1dda2 # v2.0.1
35+
with:
36+
repo: casey/just
37+
version: 1.58.0
38+
# `uvx prek` builds each hook's environment from scratch, so cache them the
39+
# way the prek action used to. Keyed on the hook config: a new pinned rev or
40+
# a new hook is exactly when the cached environments stop being valid.
41+
- name: Cache prek hook environments
42+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
43+
with:
44+
path: ~/.cache/prek
45+
# Justfile is hashed too: prek_version lives there, and a bumped prek
46+
# must not restore a store built by the previous one. No restore-keys
47+
# fallback for the same reason.
48+
key: prek-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml', 'Justfile') }}
49+
- name: Lint
50+
run: just lint
51+
- name: Check justfile formatting
52+
# After the linters, and never masking them: this is cosmetic, and a
53+
# mis-formatted recipe should not cost someone their ruff/mypy results.
54+
if: always()
55+
run: just just-check

‎.github/workflows/test.yml‎

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,21 +69,25 @@ jobs:
6969
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
7070
- name: Install Hatch
7171
run: python -m pip install hatch==1.16.5
72+
- name: Install just
73+
uses: extractions/setup-crate@7577c1bdf2d95e6d65d532788f35ed79d4b1dda2 # v2.0.1
74+
with:
75+
repo: casey/just
76+
version: 1.58.0
7277
- name: Set Up Hatch Env
7378
env:
7479
HATCH_ENV: test.py${{ matrix.python-version }}-${{ matrix.dependency-set }}
7580
run: |
76-
hatch env create "$HATCH_ENV"
77-
hatch env run -e "$HATCH_ENV" list-env
81+
just setup
7882
- name: Run Tests
7983
env:
8084
HYPOTHESIS_PROFILE: ci
8185
HATCH_ENV: test.py${{ matrix.python-version }}-${{ matrix.dependency-set }}
8286
run: |
83-
hatch env run --env "$HATCH_ENV" run-coverage
87+
just coverage
8488
- name: Upload coverage
8589
if: ${{ matrix.dependency-set == 'optional' && matrix.os == 'ubuntu-latest' }}
86-
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
90+
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
8791
with:
8892
token: ${{ secrets.CODECOV_TOKEN }}
8993
flags: tests
@@ -118,19 +122,23 @@ jobs:
118122
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
119123
- name: Install Hatch
120124
run: python -m pip install hatch==1.16.5
125+
- name: Install just
126+
uses: extractions/setup-crate@7577c1bdf2d95e6d65d532788f35ed79d4b1dda2 # v2.0.1
127+
with:
128+
repo: casey/just
129+
version: 1.58.0
121130
- name: Set Up Hatch Env
122131
env:
123132
HATCH_ENV: ${{ matrix.dependency-set }}
124133
run: |
125-
hatch env create "$HATCH_ENV"
126-
hatch env run -e "$HATCH_ENV" list-env
134+
just setup
127135
- name: Run Tests
128136
env:
129137
HATCH_ENV: ${{ matrix.dependency-set }}
130138
run: |
131-
hatch env run --env "$HATCH_ENV" run-coverage
139+
just coverage
132140
- name: Upload coverage
133-
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
141+
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
134142
with:
135143
token: ${{ secrets.CODECOV_TOKEN }}
136144
flags: tests
@@ -153,12 +161,17 @@ jobs:
153161
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
154162
- name: Install Hatch
155163
run: python -m pip install hatch==1.16.5
164+
- name: Install just
165+
uses: extractions/setup-crate@7577c1bdf2d95e6d65d532788f35ed79d4b1dda2 # v2.0.1
166+
with:
167+
repo: casey/just
168+
version: 1.58.0
156169
- name: Set Up Hatch Env
157170
run: |
158-
hatch run doctest:pip list
171+
HATCH_ENV=doctest just setup
159172
- name: Run Tests
160173
run: |
161-
hatch run doctest:test
174+
just doctest
162175
163176
benchmarks:
164177
name: Benchmark smoke test
@@ -177,11 +190,16 @@ jobs:
177190
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
178191
- name: Install Hatch
179192
run: python -m pip install hatch==1.16.5
193+
- name: Install just
194+
uses: extractions/setup-crate@7577c1bdf2d95e6d65d532788f35ed79d4b1dda2 # v2.0.1
195+
with:
196+
repo: casey/just
197+
version: 1.58.0
180198
- name: Run Benchmarks
181199
env:
182200
ZARR_BENCHMARK_CLEAR_CACHE: '1'
183201
run: |
184-
hatch env run --env "test.py3.13-minimal" run-benchmark
202+
HATCH_ENV=test.py3.13-minimal just benchmark
185203
186204
test-complete:
187205
name: Test complete

‎.github/workflows/zarr-http-server-release.yml‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,34 @@ jobs:
6464
uv run --with "${wheel}" --python 3.12 --no-project \
6565
python -c "import zarr_http_server; print('zarr_http_server', zarr_http_server.__version__)"
6666
67+
# The sdist has to stand alone, and `hatch build` above builds the wheel
68+
# from the source tree, not from the sdist. So build a wheel from the
69+
# sdist with pip, which unpacks it under the sdist format's rules (no
70+
# links out of the archive), then run the package's own tests and strict
71+
# docs build from the unpacked sdist. This job has no checkout, so
72+
# nothing comes from the repository; zarr, where a package uses it,
73+
# resolves from PyPI.
74+
- name: Build a wheel from the sdist with pip
75+
run: |
76+
sdist=$(ls dist/*.tar.gz)
77+
uvx --python 3.12 pip@26.2.1 wheel --no-deps --wheel-dir sdist-wheel "${sdist}"
78+
79+
- name: Install just
80+
uses: extractions/setup-crate@7577c1bdf2d95e6d65d532788f35ed79d4b1dda2 # v2.0.1
81+
with:
82+
repo: casey/just
83+
version: 1.58.0
84+
85+
- name: Test and build docs from the unpacked sdist
86+
env:
87+
UV_PYTHON: '3.12'
88+
run: |
89+
mkdir sdist
90+
tar -xzf dist/*.tar.gz -C sdist
91+
cd sdist/*/
92+
just test
93+
just docs-check
94+
6795
upload_pypi:
6896
name: Upload to PyPI
6997
needs: [build, test_artifacts]

‎.github/workflows/zarr-http-server.yml‎

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,19 @@ on:
1111
paths:
1212
- 'packages/zarr-http-server/**'
1313
- '.github/workflows/zarr-http-server.yml'
14+
# The docs config and header script shared by all package sites.
15+
- 'packages/mkdocs-base.yml'
16+
- 'packages/source-version.js'
1417
# The package resolves zarr from the repo root for its own tests, so a
1518
# core change can break it. Run this suite when core changes too.
1619
- 'src/zarr/**'
1720
pull_request:
1821
paths:
1922
- 'packages/zarr-http-server/**'
2023
- '.github/workflows/zarr-http-server.yml'
24+
# The docs config and header script shared by all package sites.
25+
- 'packages/mkdocs-base.yml'
26+
- 'packages/source-version.js'
2127
# The package resolves zarr from the repo root for its own tests, so a
2228
# core change can break it. Run this suite when core changes too.
2329
- 'src/zarr/**'
@@ -53,11 +59,10 @@ jobs:
5359
- name: Set up Python ${{ matrix.python-version }}
5460
run: uv python install ${{ matrix.python-version }}
5561
- name: Install just
56-
uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4
62+
uses: extractions/setup-crate@7577c1bdf2d95e6d65d532788f35ed79d4b1dda2 # v2.0.1
5763
with:
58-
# Pin the tool, not just the action: without this the action
59-
# installs whatever just is newest at run time.
60-
just-version: 1.58.0
64+
repo: casey/just
65+
version: 1.58.0
6166
- name: Sync test dependency groups
6267
# The examples group carries the deps the README examples need, so the
6368
# test that reads a served array back with a zarr client runs here
@@ -80,11 +85,10 @@ jobs:
8085
- name: Install uv
8186
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
8287
- name: Install just
83-
uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4
88+
uses: extractions/setup-crate@7577c1bdf2d95e6d65d532788f35ed79d4b1dda2 # v2.0.1
8489
with:
85-
# Pin the tool, not just the action: without this the action
86-
# installs whatever just is newest at run time.
87-
just-version: 1.58.0
90+
repo: casey/just
91+
version: 1.58.0
8892
- name: Run ruff
8993
run: just lint
9094

@@ -106,11 +110,10 @@ jobs:
106110
- name: Set up Python
107111
run: uv python install 3.12
108112
- name: Install just
109-
uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4
113+
uses: extractions/setup-crate@7577c1bdf2d95e6d65d532788f35ed79d4b1dda2 # v2.0.1
110114
with:
111-
# Pin the tool, not just the action: without this the action
112-
# installs whatever just is newest at run time.
113-
just-version: 1.58.0
115+
repo: casey/just
116+
version: 1.58.0
114117
- name: Sync test dependency group
115118
run: uv sync --group test --python 3.12
116119
- name: Run mypy
@@ -132,11 +135,10 @@ jobs:
132135
with:
133136
enable-cache: true
134137
- name: Install just
135-
uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4
138+
uses: extractions/setup-crate@7577c1bdf2d95e6d65d532788f35ed79d4b1dda2 # v2.0.1
136139
with:
137-
# Pin the tool, not just the action: without this the action
138-
# installs whatever just is newest at run time.
139-
just-version: 1.58.0
140+
repo: casey/just
141+
version: 1.58.0
140142
- name: Build docs
141143
run: just docs-check
142144

0 commit comments

Comments
 (0)