Open coretl opened 1 year ago
The other option would be to change __init__.py
to always import from _version.py
:
try:
from ._version import __version__
except ImportError:
__version__ = "not-installed"
but maybe importlib is more standard
I think #81 removed the ability to check versions with a git archive and that is what checking in the _version.py
is for, right?
But _version.py
is not present in the archive, so I don't think it's that either...
I think it isn't giving us anything now then.
In #81 @garryod changed to get
__version__
fromimportlib.metadata
: https://github.com/DiamondLightSource/python3-pip-skeleton/blob/913fd74c8a15628f64a5823fc7255fcee1c695a2/src/python3_pip_skeleton/__init__.py#L1-L3This means that we require the module to be installed so we know the version. This means that
_version.py
is not used, ever. We can clean up here, and stop generating it: https://github.com/DiamondLightSource/python3-pip-skeleton/blob/913fd74c8a15628f64a5823fc7255fcee1c695a2/pyproject.toml#L50-L51 and ignoring it: https://github.com/DiamondLightSource/python3-pip-skeleton/blob/913fd74c8a15628f64a5823fc7255fcee1c695a2/.gitignore#L26@garryod @GDYendell @gilesknap @AlexanderWells-diamond: any reason we should not do this?