missing __version__ attribute
drammock opened this issue · 3 comments
drammock commented
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 pypiIn [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__'stefanv commented
No, that's silly!
drammock commented
No, that's silly!
I thought so, but I'm often surprised by corner cases / some reason I never would have guessed.
effigies commented
Note that for packages that do not provide __version__, you can use importlib.metadata: metadata.version('lazy_loader')