cctbx_project
cctbx_project copied to clipboard
Make cctbx_project version number programmatically accessible
Could we please have a way to programmatically determine the installed cctbx_project
package version?
I'm thinking something along the lines of
__version_tuple__ = (2020, 11)
__version__ = ".".join(str(_n) for _n in __version_tuple__)
in eg. cctbx/__init__.py
or maybe libtbx
(I hold no opinion here)
and then please add a pointer to that variable to the call in
https://github.com/cctbx/cctbx_project/blob/7590911b8ea11f82f9e0c8ecd1e818d0eb090d38/scitbx/libtbx_refresh.py#L25-L31
to the equivalent of libtbx.pkg_utils.define_entry_points(..., version="2020.11")
.
Would be nice to have that in the November+ 2020 release.
You can now get the version with
from libtbx.version import get_version
version = get_version()
The version is basically the date of the latest commit and additional information from git describe
.
I can see that being useful.
However, could we please also have a way to programmatically determine the installed cctbx_project
package version number? Ideally, this would be in a top level __version__
field, as that is sort of the convention, eg.
>>> import numpy
>>> numpy.__version__
'1.19.4'
>>> import matplotlib
>>> matplotlib.__version__
'3.3.3'