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

Please add a __version__ attribute to the module #77

Closed
bjornfor opened this issue Aug 2, 2022 · 4 comments
Closed

Please add a __version__ attribute to the module #77

bjornfor opened this issue Aug 2, 2022 · 4 comments

Comments

@bjornfor
Copy link
Contributor

bjornfor commented Aug 2, 2022

It's a very common attribute, which I missed today.

https://peps.python.org/pep-0396/
https://peps.python.org/pep-0008/

@bjornfor
Copy link
Contributor Author

bjornfor commented Aug 2, 2022

As a workaround I did pip show cppimport | awk '/Version:/{print $2}.

@tbenthompson
Copy link
Owner

Yeah, reasonable request! I made a PR (#78). Once I confirm that everything is good to go, I'll push a release.

For future reference, in Python 3.8+, you should be able to get the version of any package with:

>>> from importlib.metadata import version
>>> version("cppimport")
'22.7.17.post1+g3d3de85.d20220802'

@bjornfor
Copy link
Contributor Author

bjornfor commented Aug 2, 2022

Thanks, that was quick! (And nice workaround, TIL.)

@tbenthompson
Copy link
Owner

I just pushed a release to pypi!

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

No branches or pull requests

2 participants