Skip to content

Commit 864afeb

Browse files
committed
feat: lower minimum Python from 3.14 to 3.12
Three 3.14-only constructs prevented importing on 3.12/3.13: - unparenthesized `except A, B:` (PEP 758) -> parenthesized (3 sites) - eagerly-evaluated annotations (PEP 649) -> `from __future__ import annotations` in the 31 modules that need it - zero-arg `super()` in a `slots=True` dataclass (CPython gh-90562, fixed in 3.13) -> drop `slots=True` on DatasetSchema CI matrix now 3.12/3.13/3.14; mypy pinned to `python_version=3.12`.
1 parent 3324168 commit 864afeb

41 files changed

Lines changed: 83 additions & 15 deletions

Some content is hidden

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

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
fail-fast: false
2020
max-parallel: 5
2121
matrix:
22-
python-version: ['3.14']
22+
python-version: ['3.12', '3.13', '3.14']
2323
steps:
2424
- name: Checkout
2525
uses: actions/checkout@v4
@@ -75,7 +75,7 @@ jobs:
7575
channels:
7676
- conda-forge
7777
create-args: |
78-
python=3.14
78+
python=3.12
7979
environment-name: ZCollection
8080
environment-file: conda/environment.yml
8181

.github/workflows/docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
channels:
5555
- conda-forge
5656
create-args: |
57-
python=3.14
57+
python=3.12
5858
environment-name: ZCollection
5959
environment-file: conda/environment.yml
6060

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ jobs:
1111
- uses: actions/checkout@v4
1212
- uses: actions/setup-python@v5
1313
with:
14-
python-version: '3.14'
14+
python-version: '3.12'
1515
- uses: pre-commit/action@v3.0.1

.github/workflows/pypipublish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Set up Python
3131
uses: actions/setup-python@v5
3232
with:
33-
python-version: '3.14'
33+
python-version: '3.12'
3434

3535
- name: Install build tooling
3636
run: |

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ repos:
1717
rev: "v3.21.2"
1818
hooks:
1919
- id: pyupgrade
20-
args: [--py314-plus]
20+
args: [--py312-plus]
2121
- repo: https://github.com/astral-sh/ruff-pre-commit
2222
rev: v0.15.12
2323
hooks:

conda/environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: ZCollection
22
channels:
33
- conda-forge
44
dependencies:
5-
# Python (matches setup.cfg `python_requires = >=3.14`)
6-
- python >=3.14
5+
# Python (matches setup.cfg `python_requires = >=3.12`)
6+
- python >=3.12
77
# Runtime
88
- dask-core >=2022.8.0
99
- distributed

docs/source/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ compatibility runtime.
88
Requirements
99
------------
1010

11-
- Python **3.14** or later
11+
- Python **3.12** or later
1212
- `zarr <https://zarr.readthedocs.io/>`_ ≥ 3.1.6
1313
- `numpy <https://numpy.org/>`_ ≥ 1.20
1414
- `numcodecs <https://numcodecs.readthedocs.io/>`_ ≥ 0.13

examples/ex_netcdf_to_zcollection.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@
9898
which xarray cannot do natively without an explicit ``group=`` argument.
9999
"""
100100

101+
from __future__ import annotations
102+
101103
from typing import TYPE_CHECKING, Any
102104
import argparse
103105
from datetime import datetime

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ __version__ = "{version}"
1717

1818

1919
[tool.ruff]
20-
target-version = "py314"
20+
target-version = "py312"
2121
line-length = 80
2222

2323
[tool.ruff.lint.pycodestyle]

setup.cfg

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ classifiers =
88
Operating System :: MacOS
99
Operating System :: Microsoft :: Windows
1010
Operating System :: POSIX
11+
Programming Language :: Python :: 3.12
12+
Programming Language :: Python :: 3.13
1113
Programming Language :: Python :: 3.14
1214
Topic :: Scientific/Engineering :: Physics
1315
description = Zarr Collection
@@ -34,7 +36,7 @@ install_requires =
3436
package_dir =
3537
= .
3638
packages = find:
37-
python_requires = >=3.14
39+
python_requires = >=3.12
3840
zip_safe = False
3941

4042
[options.extras_require]
@@ -78,3 +80,4 @@ ignore =
7880
[mypy]
7981
ignore_missing_imports=True
8082
exclude=tests
83+
python_version=3.12

0 commit comments

Comments
 (0)