-
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-casestatements toif-elseblocks (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 annotationsto all files using type hints - Replaced
typingimports withtyping_extensionsfor 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.9inpyproject.toml - Renamed package to
zarr-py39 - Bundled
numcodecsdependency (for simplified maintenance):- Includes all compatibility modifications listed above
- Note: Since numcodecs contains C extensions, the
zarr-py39wheel must be compiled per Python version (e.g.,cp39Python 3.9 wheel), unlike the originalpy3generic wheel