Skip to content

Commit e7745ac

Browse files
committed
Merge branch 'feat/byte-range-setter' of https://github.com/d-v-b/zarr-python into feat/byte-range-setter
2 parents 91590dd + 7757ecd commit e7745ac

52 files changed

Lines changed: 2248 additions & 135 deletions

Some content is hidden

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

.github/ISSUE_TEMPLATE/release-checklist.md

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,39 +16,17 @@ assignees: ''
1616

1717
**Before release**:
1818

19-
- [ ] Make sure the release branch (e.g., `3.1.x`) is up to date with any backports.
20-
- [ ] Make sure that all pull requests which will be included in the release have been properly documented as changelog files in the [`changes/` directory](https://github.com/zarr-developers/zarr-python/tree/main/changes).
21-
- [ ] Run ``towncrier build --version x.y.z`` to create the changelog, and commit the result to the release branch.
2219
- [ ] Check [SPEC 0](https://scientific-python.org/specs/spec-0000/#support-window) to see if the minimum supported version of Python or NumPy needs bumping.
23-
- [ ] Check to ensure that:
24-
- [ ] Deprecated workarounds/codes/tests are removed. Run `grep "# TODO" **/*.py` to find all potential TODOs.
25-
- [ ] All tests pass in the ["Tests" workflow](https://github.com/zarr-developers/zarr-python/actions/workflows/test.yml).
26-
- [ ] All tests pass in the ["GPU Tests" workflow](https://github.com/zarr-developers/zarr-python/actions/workflows/gpu_test.yml).
27-
- [ ] All tests pass in the ["Hypothesis" workflow](https://github.com/zarr-developers/zarr-python/actions/workflows/hypothesis.yaml).
28-
- [ ] Check that downstream libraries work well (maintainers can make executive decisions about whether all checks are required for this release).
29-
- [ ] numcodecs
30-
- [ ] Xarray (@jhamman @dcherian @TomNicholas)
31-
- Zarr's upstream compatibility is tested via the [Upstream Dev CI worklow](https://github.com/pydata/xarray/actions/workflows/upstream-dev-ci.yaml).
32-
- Click on the most recent workflow and check that the `upstream-dev` job has run and passed. `upstream-dev` is not run on all all workflow runs.
33-
- Check that the expected version of Zarr-Python was tested using the `Version Info` step of the `upstream-dev` job.
34-
- If testing on a branch other than `main` is needed, open a PR modifying https://github.com/pydata/xarray/blob/90ee30943aedba66a37856b2332a41264e288c20/ci/install-upstream-wheels.sh#L56 and add the `run-upstream` label.
35-
- [ ] Titiler.Xarray (@maxrjones)
36-
- [Modify dependencies](https://github.com/developmentseed/titiler/blob/main/src/titiler/xarray/pyproject.toml) for titiler.xarray.
37-
- Modify triggers for running [the test workflow](https://github.com/developmentseed/titiler/blob/61549f2de07b20cca8fb991cfcdc89b23e18ad05/.github/workflows/ci.yml#L5-L7).
38-
- Push the branch to the repository and check for the actions for any failures.
20+
- [ ] Verify that the latest CI workflows on `main` are passing: [Tests](https://github.com/zarr-developers/zarr-python/actions/workflows/test.yml), [GPU Tests](https://github.com/zarr-developers/zarr-python/actions/workflows/gpu_test.yml), [Hypothesis](https://github.com/zarr-developers/zarr-python/actions/workflows/hypothesis.yaml), [Docs](https://github.com/zarr-developers/zarr-python/actions/workflows/docs.yml), [Lint](https://github.com/zarr-developers/zarr-python/actions/workflows/lint.yml), [Wheels](https://github.com/zarr-developers/zarr-python/actions/workflows/releases.yml).
21+
- [ ] Run the ["Prepare release" workflow](https://github.com/zarr-developers/zarr-python/actions/workflows/prepare_release.yml) with the target version. This will build the changelog and open a release PR with the `run-downstream` label.
22+
- [ ] Verify that the [downstream tests](https://github.com/zarr-developers/zarr-python/actions/workflows/downstream.yml) (triggered automatically by the `run-downstream` label) pass on the release PR.
23+
- [ ] Review the release PR and verify the changelog in `docs/release-notes.md` looks correct.
24+
- [ ] Merge the release PR.
3925

4026
**Release**:
4127

42-
- [ ] Go to https://github.com/zarr-developers/zarr-python/releases.
43-
- [ ] Click "Draft a new release".
44-
- [ ] Choose a version number prefixed with a `v` (e.g. `v0.0.0`). For pre-releases, include the appropriate suffix (e.g. `v0.0.0a1` or `v0.0.0rc2`).
45-
- [ ] Set the target branch to the release branch (e.g., `3.1.x`)
46-
- [ ] Set the description of the release to: `See release notes https://zarr.readthedocs.io/en/stable/release-notes.html#release-0-0-0`, replacing the correct version numbers. For pre-release versions, the URL should omit the pre-release suffix, e.g. "a1" or "rc1".
47-
- [ ] Click on "Generate release notes" to auto-fill the description.
48-
- [ ] Make a release by clicking the 'Publish Release' button, this will automatically create a tag too.
49-
- [ ] Verify that release workflows succeeded.
50-
- [ ] The latest version is correct on [PyPI](https://pypi.org/project/zarr/).
51-
- [ ] The stable version is correct on [ReadTheDocs](https://zarr.readthedocs.io/en/stable/).
28+
- [ ] [Draft a new GitHub Release](https://github.com/zarr-developers/zarr-python/releases/new) with tag `vX.Y.Z` targeting `main`. Use "Generate release notes" for the description.
29+
- [ ] Verify the release is published on [PyPI](https://pypi.org/project/zarr/) and [ReadTheDocs](https://zarr.readthedocs.io/en/stable/).
5230

5331
**After release**:
5432

@@ -57,3 +35,18 @@ assignees: ''
5735
---
5836

5937
- [ ] Party :tada:
38+
39+
---
40+
41+
<details>
42+
<summary><strong>Releasing from a branch other than main</strong></summary>
43+
44+
In rare cases (e.g. patch releases for an older minor version), you may need to release from a dedicated release branch (e.g. `3.1.x`):
45+
46+
- Create the release branch from the appropriate tag if it doesn't already exist.
47+
- Cherry-pick or backport the necessary commits onto the branch.
48+
- Run `towncrier build --version x.y.z` and commit the result to the release branch instead of `main`.
49+
- When drafting the GitHub Release, set the target to the release branch instead of `main`.
50+
- After the release, ensure any relevant changelog updates are also reflected on `main`.
51+
52+
</details>

.github/workflows/downstream.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: Downstream
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
types: [labeled]
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
xarray:
17+
name: Xarray zarr backend tests
18+
if: github.event_name == 'workflow_dispatch' || github.event.label.name == 'run-downstream'
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Check out zarr-python
22+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
23+
with:
24+
fetch-depth: 0
25+
persist-credentials: false
26+
27+
- name: Check out xarray
28+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
29+
with:
30+
repository: pydata/xarray
31+
path: xarray
32+
persist-credentials: false
33+
34+
- name: Set up pixi
35+
uses: prefix-dev/setup-pixi@19eac09b398e3d0c747adc7921926a6d802df4da # v0.8.8
36+
with:
37+
manifest-path: xarray/pixi.toml
38+
39+
- name: Install zarr-python from branch
40+
working-directory: xarray
41+
run: pixi run -e test-py313 -- pip install --no-deps ..
42+
43+
- name: Show versions
44+
working-directory: xarray
45+
run: |
46+
pixi run -e test-py313 -- python -c "
47+
import zarr; print(f'zarr {zarr.__version__}')
48+
import xarray; print(f'xarray {xarray.__version__}')
49+
"
50+
51+
- name: Run xarray zarr backend tests
52+
working-directory: xarray
53+
run: |
54+
pixi run -e test-py313 -- python -m pytest -x --no-header -q \
55+
xarray/tests/test_backends.py -k zarr \
56+
xarray/tests/test_backends_api.py -k zarr \
57+
xarray/tests/test_backends_datatree.py -k zarr
58+
59+
numcodecs:
60+
name: numcodecs zarr3 codec tests
61+
if: github.event_name == 'workflow_dispatch' || github.event.label.name == 'run-downstream'
62+
runs-on: ubuntu-latest
63+
steps:
64+
- name: Check out zarr-python
65+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
66+
with:
67+
fetch-depth: 0
68+
persist-credentials: false
69+
70+
- name: Check out numcodecs
71+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
72+
with:
73+
repository: zarr-developers/numcodecs
74+
fetch-depth: 0
75+
path: numcodecs
76+
submodules: recursive
77+
persist-credentials: false
78+
79+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
80+
with:
81+
python-version: '3.13'
82+
83+
- name: Install uv
84+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
85+
86+
- name: Install numcodecs with test-zarr-main group
87+
working-directory: numcodecs
88+
run: |
89+
uv venv
90+
uv pip install --group dev
91+
uv sync --group dev --group test-zarr-main
92+
uv pip install --no-build-isolation -e .
93+
94+
- name: Override zarr-python with branch version
95+
working-directory: numcodecs
96+
run: uv pip install --no-deps ..
97+
98+
- name: Show versions
99+
working-directory: numcodecs
100+
run: |
101+
uv run python -c "
102+
import zarr; print(f'zarr {zarr.__version__}')
103+
import numcodecs; print(f'numcodecs {numcodecs.__version__}')
104+
"
105+
106+
- name: Run numcodecs zarr3 tests
107+
working-directory: numcodecs
108+
run: uv run python -m pytest -x --no-header -q tests/test_zarr3.py
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Prepare release notes
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Release version notes (e.g. 3.2.0)'
8+
required: true
9+
type: string
10+
target_branch:
11+
description: 'Branch to target'
12+
required: false
13+
default: 'main'
14+
type: string
15+
16+
permissions:
17+
contents: write
18+
pull-requests: write
19+
20+
jobs:
21+
prepare:
22+
name: Build changelog and open PR
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Validate inputs
26+
run: |
27+
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+([-\.][a-zA-Z0-9]+)*$ ]]; then
28+
echo "::error::Invalid version format: '$VERSION'"
29+
exit 1
30+
fi
31+
if [[ ! "$TARGET_BRANCH" =~ ^[a-zA-Z0-9._/-]+$ ]]; then
32+
echo "::error::Invalid branch name: '$TARGET_BRANCH'"
33+
exit 1
34+
fi
35+
env:
36+
VERSION: ${{ inputs.version }}
37+
TARGET_BRANCH: ${{ inputs.target_branch }}
38+
39+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
40+
with:
41+
ref: ${{ inputs.target_branch }}
42+
fetch-depth: 0
43+
persist-credentials: false
44+
45+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
46+
with:
47+
python-version: '3.12'
48+
49+
- name: Install towncrier
50+
run: pip install towncrier
51+
52+
- name: Build changelog
53+
run: towncrier build --version "$VERSION" --yes
54+
env:
55+
VERSION: ${{ inputs.version }}
56+
57+
- name: Create pull request
58+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
59+
with:
60+
branch: release/v${{ inputs.version }}
61+
base: ${{ inputs.target_branch }}
62+
title: "Release v${{ inputs.version }}"
63+
body: |
64+
Automated release preparation for v${{ inputs.version }}.
65+
66+
This PR was generated by the "Prepare release" workflow. It includes:
67+
- Rendered changelog via `towncrier build --version ${{ inputs.version }}`
68+
- Removal of consumed changelog fragments from `changes/`
69+
70+
## Checklist
71+
72+
- [ ] Review the rendered changelog in `docs/release-notes.md`
73+
- [ ] Downstream tests pass (see [downstream workflow](https://github.com/zarr-developers/zarr-python/actions/workflows/downstream.yml))
74+
- [ ] Merge this PR, then [draft a GitHub Release](https://github.com/zarr-developers/zarr-python/releases/new) targeting `${{ inputs.target_branch }}` with tag `v${{ inputs.version }}`
75+
commit-message: "chore: build changelog for v${{ inputs.version }}"
76+
labels: run-downstream
77+
delete-branch: true

changes/2720.doc.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

changes/3492.doc.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

changes/3546.misc.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

changes/3611.bugfix.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

changes/3679.feature.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

changes/3748.feature.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

changes/3781.feature.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)