Using :attr: to get the version from pyhepmc/_version.py does not work when the installation fails due to some compilation error, making pyhepmc unimportable. :attr: is supposed to not invoke the Python interpreter to get the version literal, but for some reason this is not working. I suppose this only works when the version is a literal in __init__.py, but it is a literal in pyhepmc/_version.py. Since we cannot get rid of setup.py, because we need this to declare the CMakeExtensions there, we can just as well safely pull the version by execing _version.py from there.
Using
:attr:
to get the version from pyhepmc/_version.py does not work when the installation fails due to some compilation error, making pyhepmc unimportable.:attr:
is supposed to not invoke the Python interpreter to get the version literal, but for some reason this is not working. I suppose this only works when the version is a literal in__init__.py
, but it is a literal inpyhepmc/_version.py
. Since we cannot get rid ofsetup.py
, because we need this to declare the CMakeExtensions there, we can just as well safely pull the version byexec
ing_version.py
from there.