dcor
dcor copied to clipboard
__version__ returns 0.0. Version number is on a separate file
Hello. Thank you for this very useful package. I need to query the version installed and check that it is >=0.5.3.
In dcor/init.py
try: with open(_os.path.join(_os.path.dirname(file), '..', 'VERSION'), 'r') as version_file: version = version_file.read().strip() except IOError as e: if e.errno != _errno.ENOENT: raise
__version__ = "0.0"
You are reading the version from the VERSION file and at the end anyway forcing the version number to be 0.0. This is always returning 0.0 when i do
import dcor print(dcor.version)
Ok, this is a mistake from my part. The VERSION
file is not there if the project is installed from PyPI or Conda, so that returns 0.0. In order to fix it, I need to move the file to the actual dcor
folder and fix the links.
In the meantime you can use the following more faithful and verbose solution:
try:
from importlib import metadata
except ImportError:
import importlib_metadata as metadata # python<=3.7
metadata.version("dcor")
This is great. Thank you so much for the quick reply.
No, please leave it open. I will try to fix __version__
when I have time.
Sure, got it.
This is supposed to be solved in 0.5.5. If you can, please check that you have no problems with that version.
As I mentioned, the problem is supposed to be solved, so I close this issue. Please reopen if the problem persists.