-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path_version.py
More file actions
executable file
·26 lines (19 loc) · 670 Bytes
/
Copy path_version.py
File metadata and controls
executable file
·26 lines (19 loc) · 670 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env python3
from pathlib import Path
from version_pioneer.api import get_version_dict_wo_exec
def get_version_dict():
# NOTE: during installation, __file__ is not defined
# When installed in editable mode, __file__ is defined
# When installed in standard mode (when built), this file is replaced to a compiled versionfile.
if "__file__" in globals():
cwd = Path(__file__).parent
else:
cwd = Path.cwd()
return get_version_dict_wo_exec(
cwd=cwd,
style="pep440-master",
tag_prefix="v",
)
if __name__ == "__main__":
import json
print(json.dumps(get_version_dict())) # noqa: T201