Skip to content

v2->v3 zarr.meta module name change breaks imports #2021

Closed
@ghidalgo3

Description

@ghidalgo3

Zarr version

3.0.0a0

Numcodecs version

0.12.1

Python Version

3.10.12

Operating System

Linux

Installation

pip install zarr==3.0.0a0

Description

In ZarrV3, the reorganization of the V2 code into the v2 module requires consumers to change their import stanzas to include a .v2.. See this line in Kerchunk for example, now it needs to read from zarr.v2.meta import encode_fill_value .

I'm trying to make VirtualiZarr depend on ZarrV3 for the ArrayMetadata classes in this PR but ZarrV3 causes a problem for Kerchunk due to the module name change.

I think given the discussion on this issue, I think this is intended and the solution is for Kerchunk to add a lower bound to ZarrV3 and change its import statements. However that may be disruptive to many users if there is no plan to maintain the import paths the same.

Steps to reproduce

Simply attempt to import kerchunk.hdf.

import kerchunk.hdf # ModuleNotFoundError: No module named 'zarr.meta'

Additional output

pip freeze

aiobotocore==2.13.1
aiohttp==3.9.5
aioitertools==0.11.0
aiosignal==1.3.1
annotated-types==0.7.0
asciitree==0.3.3
asttokens==2.4.1
async-timeout==4.0.3
attrs==23.2.0
botocore==1.34.131
certifi==2024.7.4
cfgv==3.4.0
cftime==1.6.4
charset-normalizer==3.3.2
codecov==2.1.13
coverage==7.5.4
cramjam==2.8.3
crc32c==2.4.1
decorator==5.1.1
distlib==0.3.8
donfig==0.8.1.post1
exceptiongroup==1.2.1
executing==2.0.1
fasteners==0.19
fastparquet==2024.5.0
filelock==3.15.4
frozenlist==1.4.1
fsspec==2024.6.1
h5netcdf==1.3.0
h5py==3.11.0
identify==2.6.0
idna==3.7
iniconfig==2.0.0
ipython==8.26.0
jedi==0.19.1
jmespath==1.0.1
kerchunk==0.2.6
matplotlib-inline==0.1.7
multidict==6.0.5
mypy==1.10.1
mypy-extensions==1.0.0
netCDF4==1.7.1.post1
nodeenv==1.9.1
numcodecs==0.12.1
numpy==2.0.0
packaging==24.1
pandas==2.2.2
parso==0.8.4
pexpect==4.9.0
platformdirs==4.2.2
pluggy==1.5.0
pooch==1.8.2
pre-commit==3.7.1
prompt_toolkit==3.0.47
ptyprocess==0.7.0
pure-eval==0.2.2
pydantic==2.8.2
pydantic_core==2.20.1
Pygments==2.18.0
pytest==8.2.2
pytest-cov==5.0.0
pytest-mypy==0.10.3
python-dateutil==2.9.0.post0
pytz==2024.1
PyYAML==6.0.1
requests==2.32.3
ruff==0.5.1
s3fs==2024.6.1
scipy==1.14.0
six==1.16.0
stack-data==0.6.3
tomli==2.0.1
traitlets==5.14.3
typing_extensions==4.12.2
tzdata==2024.1
ujson==5.10.0
universal_pathlib==0.2.2
urllib3==2.2.2
virtualenv==20.26.3
-e git+https://github.com/zarr-developers/VirtualiZarr@92a7e81876bf89ebab4bc1d738d65fd935b06c6e#egg=virtualizarr
wcwidth==0.2.13
wrapt==1.16.0
xarray==2024.6.0
yarl==1.9.4
-e git+https://github.com/zarr-developers/zarr-python@ace96f569490882e89c181387d27f20b0babd6a1#egg=zarr
zstandard==0.22.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPotential issues with the zarr-python library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions