Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing __version__ attribute #96

Closed
drammock opened this issue Feb 2, 2024 · 3 comments · Fixed by #97
Closed

missing __version__ attribute #96

drammock opened this issue Feb 2, 2024 · 3 comments · Fixed by #97

Comments

@drammock
Copy link

drammock commented Feb 2, 2024

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__'
@stefanv
Copy link
Member

stefanv commented Feb 2, 2024

No, that's silly!

@drammock
Copy link
Author

drammock commented Feb 2, 2024

No, that's silly!

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

@effigies
Copy link
Collaborator

effigies commented Feb 2, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants