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

[REQUEST] add attribute __version__ #1754

Closed
Salim9304 opened this issue Dec 14, 2021 · 5 comments
Closed

[REQUEST] add attribute __version__ #1754

Salim9304 opened this issue Dec 14, 2021 · 5 comments

Comments

@Salim9304
Copy link

The rich api changes frequently, requires access to the current version of lib rich (print (rich .__ version__)) from the python interpreter itself.

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

@willmcgugan
Copy link
Collaborator

@github-actions
Copy link

Did I solve your problem?

Consider sponsoring the ongoing work on Rich and Textual.

Or buy me a coffee to say thanks.

Will McGugan

@Salim9304
Copy link
Author

https://github.com/willmcgugan/rich/issues?q=is%3Aissue+is%3Aclosed++__version__

The link is empty. I also could not find information on the __version request.
Can you tell us what you mean? 🤗

@willmcgugan

@willmcgugan
Copy link
Collaborator

Search issues for version

@Salim9304
Copy link
Author

Solution I found (I'm sorry I wasted my time on this). It's not worth it.

 import pkg_resources
 pkg_resources.get_distribution("rich").version

9.5.0

I don't want to take this approach (it's slow and resource-intensive). I'm not even sure if it worked on my system, it might not work for others.
Better to duplicate code than importlib_metadata (comments on issues on this topic speak for themselves).
python-poetry/poetry#144

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

No branches or pull requests

2 participants