-
Notifications
You must be signed in to change notification settings - Fork 26
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
add __version__
to python module
#122
Comments
I think the right way to do this is to get the information from Cmake into the c++ library at compile time, then export that function to the python. This website (https://community.gigperformer.com/t/getting-cmake-variables-from-c/17711) documents a way to have CMake generate a version.hpp file with the necessary information. Creating a function to return the info would be easy, as would exporting the info to python. Not sure about how we'd get the function called to set version, though. |
I think we just need to literally put it in the python module swig creates at the top level, and also in the pyloos. We could probably use a shell script to sed it in, or a python script that replaces it in, after those files are created during the build process. There are comments about this in PEP8. So it could be as simple as putting:
in the module files, then having a script that build runs replace |
Is your feature request related to a problem? Please describe
I just like to be able to check the software version from the python import, as opposed to querying conda or rooting around in an install dir. Makes reporting other issues easier too.
Describe the solution you'd like
Add a
__version__
attribute to the python module, which is customary for python modules.Describe alternatives you've considered
You can currently solve this problem with
conda list | grep loos
...Additional context
None
The text was updated successfully, but these errors were encountered: