updates 38.1 90
This commit is contained in:
10
ctrl/spr.py
10
ctrl/spr.py
@@ -73,7 +73,15 @@ def get_version(comp_type, source):
|
||||
for line in (source / "pyproject.toml").read_text().splitlines():
|
||||
if line.strip().startswith("version"):
|
||||
return line.split('"')[1]
|
||||
except FileNotFoundError:
|
||||
elif comp_type == "python":
|
||||
# A plain package: no package.json, no pyproject.toml, just
|
||||
# __version__ in __init__.py. station/tools/common is one -- it is
|
||||
# imported and vendored, never installed, so giving it packaging
|
||||
# metadata to satisfy this function would be the tail wagging the dog.
|
||||
for line in (source / "__init__.py").read_text().splitlines():
|
||||
if line.strip().startswith("__version__"):
|
||||
return line.split('"')[1] if '"' in line else line.split("'")[1]
|
||||
except (FileNotFoundError, IndexError):
|
||||
pass
|
||||
return "?"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user