tbenthompson / cppimport

Import C++ files directly from Python!
MIT License
1.18k stars 67 forks source link

Please add a __version__ attribute to the module #77

Closed bjornfor closed 2 years ago

bjornfor commented 2 years ago

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

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

bjornfor commented 2 years ago

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

tbenthompson commented 2 years ago

Yeah, reasonable request! I made a PR (https://github.com/tbenthompson/cppimport/pull/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 commented 2 years ago

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

tbenthompson commented 2 years ago

I just pushed a release to pypi!