Fixed missing version resolution without pyproject.toml

This commit is contained in:
Mark Qvist 2023-05-11 20:52:15 +02:00
parent 494ebb29fb
commit 4897cd0387

View file

@ -30,6 +30,10 @@ def _get_version():
try: try:
import tomli import tomli
return tomli.load(open(os.path.join(os.path.dirname(module_dir), "pyproject.toml"), "rb"))["tool"]["poetry"]["version"] return tomli.load(open(os.path.join(os.path.dirname(module_dir), "pyproject.toml"), "rb"))["tool"]["poetry"]["version"]
except:
try:
import pkg_resources
return pkg_resources.get_distribution("rnsh").version
except: except:
return "0.0.0" return "0.0.0"