Skip to content

Commit 897fbaf

Browse files
authored
Merge branch 'main' into chore/docstring-and-lint-fixes
2 parents 31d756d + cdb2130 commit 897fbaf

23 files changed

Lines changed: 251 additions & 101 deletions

File tree

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ updates:
55
directory: /
66
schedule:
77
interval: weekly
8+
cooldown:
9+
default-days: 7
810
groups:
911
actions:
1012
patterns:

.github/workflows/cd.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,20 @@ on:
77
branches: [ main ]
88
workflow_dispatch:
99

10+
permissions: {}
11+
1012
jobs:
1113
build:
1214
name: Build and publish Python 🐍 distributions 📦 to PyPI
1315
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
1418
steps:
15-
- uses: actions/checkout@v6
19+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
20+
with:
21+
persist-credentials: false
1622
- name: Set up Python
17-
uses: actions/setup-python@v6
23+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
1824
with:
1925
python-version: "3.x"
2026
- name: Install Hatch
@@ -24,7 +30,7 @@ jobs:
2430
run: |
2531
hatch build
2632
- name: Store the distribution packages
27-
uses: actions/upload-artifact@v5
33+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
2834
with:
2935
name: python-package-distributions
3036
path: dist/
@@ -36,14 +42,17 @@ jobs:
3642
needs:
3743
- build
3844
runs-on: ubuntu-latest
45+
environment:
46+
name: release
47+
url: https://pypi.org/p/pydantic-zarr
48+
permissions:
49+
id-token: write # IMPORTANT: mandatory for trusted publishing
3950

4051
steps:
4152
- name: Download all the dists
42-
uses: actions/download-artifact@v6
53+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
4354
with:
4455
name: python-package-distributions
4556
path: dist/
4657
- name: Publish distribution 📦 to PyPI
47-
uses: pypa/gh-action-pypi-publish@release/v1
48-
with:
49-
password: ${{ secrets.PYPI_API_TOKEN }}
58+
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0

.github/workflows/check_changelogs.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,22 @@ name: Check changelog entries
33
on:
44
pull_request:
55

6+
permissions: {}
7+
68
jobs:
79
check-changelogs:
810
name: Check changelog entries
911
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
1014

1115
steps:
12-
- uses: actions/checkout@v6
16+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
17+
with:
18+
persist-credentials: false
1319

1420
- name: Install uv
15-
uses: astral-sh/setup-uv@v7
21+
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
1622

1723
- name: Check changelog entries
1824
run: uv run --no-sync python ci/check_changelog_entries.py

.github/workflows/pre-commit.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@ on:
55
push:
66
branches: [main]
77

8+
permissions: {}
9+
810
jobs:
911
pre-commit:
1012
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
1115
steps:
12-
- uses: actions/checkout@v6
13-
- uses: actions/setup-python@v6
14-
- uses: pre-commit/action@v3.0.1
16+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
17+
with:
18+
persist-credentials: false
19+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
20+
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1

.github/workflows/test.yml

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ on:
1010
branches: [ main ]
1111
workflow_dispatch:
1212

13+
permissions: {}
14+
1315
concurrency:
1416
group: ${{ github.workflow }}-${{ github.ref }}
1517
cancel-in-progress: true
@@ -18,17 +20,22 @@ jobs:
1820
test:
1921
name: os=${{ matrix.os }}, py=${{ matrix.python-version }}, zarr-python=${{ matrix.zarr-version }}
2022

23+
permissions:
24+
contents: read
25+
2126
strategy:
2227
matrix:
23-
python-version: ['3.11', '3.12', '3.13', '3.14']
28+
python-version: ['3.12', '3.13', '3.14']
2429
zarr-version: ['3.0.10', '3.1.0', 'none']
2530
os: ["ubuntu-latest"]
2631
runs-on: ${{ matrix.os }}
2732

2833
steps:
29-
- uses: actions/checkout@v6
34+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
35+
with:
36+
persist-credentials: false
3037
- name: Set up Python
31-
uses: actions/setup-python@v6
38+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
3239
with:
3340
python-version: ${{ matrix.python-version }}
3441
cache: 'pip'
@@ -47,22 +54,25 @@ jobs:
4754
hatch run test-base.py${{ matrix.python-version }}:list-env
4855
hatch run test-base.py${{ matrix.python-version }}:test-cov
4956
- name: Upload coverage
50-
uses: codecov/codecov-action@v5
57+
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6.0.2
5158
with:
5259
token: ${{ secrets.CODECOV_TOKEN }}
5360
verbose: true # optional (default = false)
5461

5562
doctests:
5663
name: doctests
5764
runs-on: ubuntu-latest
65+
permissions:
66+
contents: read
5867
steps:
59-
- uses: actions/checkout@v6
68+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
6069
with:
6170
fetch-depth: 0 # required for hatch version discovery, which is needed for numcodecs.zarr3
71+
persist-credentials: false
6272
- name: Set up Python
63-
uses: actions/setup-python@v6
73+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
6474
with:
65-
python-version: '3.11'
75+
python-version: '3.12'
6676
cache: 'pip'
6777
- name: Install Hatch
6878
run: |
@@ -74,12 +84,16 @@ jobs:
7484
7585
test-min-reqs:
7686
runs-on: ubuntu-latest
87+
permissions:
88+
contents: read
7789
steps:
78-
- uses: actions/checkout@v6
90+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
91+
with:
92+
persist-credentials: false
7993
- name: Set up Python
80-
uses: actions/setup-python@v6
94+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
8195
with:
82-
python-version: '3.11'
96+
python-version: '3.12'
8397
- name: Install minimum requirements
8498
run: |
8599
pip install .

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,7 @@ repos:
4545
rev: v1.8.0
4646
hooks:
4747
- id: numpydoc-validation
48+
- repo: https://github.com/zizmorcore/zizmor-pre-commit
49+
rev: v1.25.2
50+
hooks:
51+
- id: zizmor

.readthedocs.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ mkdocs:
1616
# Optionally declare the Python requirements required to build your docs
1717
python:
1818
install:
19-
- method: pip
20-
path: .
21-
extra_requirements:
19+
- method: uv
20+
command: sync
21+
groups:
2222
- docs

changes/166.feature.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added support for the v2 chunk key encoding (`{"name": "v2", "configuration": {"separator": ...}}`) in the experimental `pydantic_zarr.experimental.v3` module, so experimental `ArraySpec` can model and round-trip Zarr v3 arrays that use it.

changes/167.bugfix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed unreachable match arms in `parse_dtype_v3` (in both `pydantic_zarr.v3` and `pydantic_zarr.experimental.v3`) where copy-paste errors caused `float64` and `complex64` numpy dtypes to raise `ValueError: Unsupported dtype` instead of returning the correct string names.

docs/release-notes.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
<!-- towncrier release notes start -->
44

5+
## pydantic-zarr 0.10.0 (2026-04-16)
6+
7+
### Features
8+
9+
- The minimum supported Python is now 3.12 and the minimum supported NumPy is now 2.0. ([#145](https://github.com/zarr-developers/pydantic-zarr/issues/145))
10+
- Use `type ...` instead of `...: TypeAlias` to declare type aliases. ([#145](https://github.com/zarr-developers/pydantic-zarr/issues/145))
11+
512
## pydantic-zarr 0.9.2 (2026-03-18)
613

714
### Features

0 commit comments

Comments
 (0)