zfp icon indicating copy to clipboard operation
zfp copied to clipboard

Get zfpy package version issue

Open afj-qeye opened this issue 2 months ago • 1 comments

Some packages (e.g numcodecs) try to probe zfpy version to ensure correct version.

import zfpy
zfpy.__version__

Results in AttributeError: module 'zfpy' has no attribute '__version__'

And no package metadata can be found either (used in numcodecs)

from importlib.metadata import version
version("zfpy")
Traceback (most recent call last):
  File "/anaconda3/2025.06/envs/qeye3/lib/python3.13/importlib/metadata/__init__.py", line 407, in from_name
    return next(iter(cls.discover(name=name)))
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "version_zfpy.py", line 3, in <module>
    version("zfpy")
    ~~~~~~~^^^^^^^^
  File "/anaconda3/2025.06/envs/qeye3/lib/python3.13/importlib/metadata/__init__.py", line 987, in version
    return distribution(distribution_name).version
           ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/anaconda3/2025.06/envs/qeye3/lib/python3.13/importlib/metadata/__init__.py", line 960, in distribution
    return Distribution.from_name(distribution_name)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/anaconda3/2025.06/envs/qeye3/lib/python3.13/importlib/metadata/__init__.py", line 409, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for zfpy

afj-qeye avatar Oct 28 '25 14:10 afj-qeye

It probably would make sense to add something like __version__ = ZFP_VERSION_STRING to zfpy. @Danielle-Asher I believe you were working on something along these lines a while back.

With respect to numcodecs, it seems that this issue could be temporarily resolved by adding something similar to the zfpy wrapper.

lindstro avatar Oct 28 '25 15:10 lindstro