-
Clone this repository:
git clone https://github.com/chip44/zarr-python-39.git cd zarr-python-39
-
Set up virtual environment:
python -m venv venv source venv/bin/activate pip install hatch
-
Build the package:
hatch build
- Converted all
match-case
statements toif-else
blocks (only appeared in test files) - Replaced star-unpacking in indices (
arr[*selection]
) with explicit tuple conversion (arr[tuple(selection)]
) (only appeared in test files) - Reordered class fields to follow Python 3.9's requirement (non-default fields must precede fields with defaults) (might cause breakage?)
- Converted union type operators (
|
) toUnion[]
declarations (only in type declarations, since type hints in methods/classes are not checked at runtime) - Replaced
isinstance()
union checks (|
) with tuple-based checks - Added
from __future__ import annotations
to all files using type hints - Replaced
typing
imports withtyping_extensions
for modern type hints (e.g.Self
,TypeAlias
)
zip(strict=True)
: Implemented a custom wrapper (_compat.py
) and imported globally@dataclass(kw_only=True)
: Implemented a custom wrapper (_compat.py
) and imported globallyitertools.pairwise()
: Implemented an equivalent replacement (single occurrence)importlib.metadata
: Replaced withimportlib_metadata
(also added as a dependency)
- Set minimum Python version to
3.9
inpyproject.toml
- Renamed package to
zarr-py39
- Bundled
numcodecs
dependency (for simplified maintenance):- Includes all compatibility modifications listed above
- Note: Since numcodecs contains C extensions, the
zarr-py39
wheel must be compiled per Python version (e.g.,cp39
Python 3.9 wheel), unlike the originalpy3
generic wheel