mirror of
https://github.com/markqvist/rnsh.git
synced 2025-06-07 05:52:40 -04:00
Fixed missing version resolution without pyproject.toml
This commit is contained in:
parent
494ebb29fb
commit
4897cd0387
1 changed files with 5 additions and 1 deletions
|
@ -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"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue