scientific-python/lazy-loader

missing __version__ attribute

drammock opened this issue · 3 comments

Is the lack of __version__ intentional / necessary?

$ mamba list lazy-loader
# packages in environment at /opt/mambaforge/envs/mnedev:
#
# Name                    Version                   Build  Channel
lazy-loader               0.3                      pypi_0    pypi
In [1]: import lazy_loader
In [2]: lazy_loader.__version__
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[2], line 1
----> 1 lazy_loader.__version__

AttributeError: module 'lazy_loader' has no attribute '__version__'

No, that's silly!

No, that's silly!

I thought so, but I'm often surprised by corner cases / some reason I never would have guessed.

Note that for packages that do not provide __version__, you can use importlib.metadata: metadata.version('lazy_loader')