Skip to content

Commit b961fc8

Browse files
author
Jacob Truman
committed
XENG-8957 Move base version to BASE_VERSION file at root of repo
1 parent 20e8ffc commit b961fc8

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

BASE_VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.15

scripts/write-version.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@
1010

1111

1212
def main():
13-
major = 3
14-
minor = 15
13+
base_dir = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir))
14+
base_version_file = os.path.join(base_dir, "BASE_VERSION")
15+
16+
with open(base_version_file, "r") as file:
17+
base_version = file.read().strip()
18+
19+
major, minor = map(int, base_version.split(".")[:2])
20+
1521
try:
1622
commit_count = (
1723
subprocess.check_output(["git", "rev-list", "--count", "HEAD"])
@@ -21,11 +27,7 @@ def main():
2127
except Exception:
2228
commit_count = "0"
2329

24-
version_file = os.path.join(
25-
os.path.abspath(os.path.join(__file__, os.pardir, os.pardir)),
26-
"buildrunner",
27-
"version.py",
28-
)
30+
version_file = os.path.join(base_dir, "buildrunner", "version.py")
2931

3032
version = f"{major}.{minor}.{commit_count}"
3133
with open(version_file, "w") as version_file:

0 commit comments

Comments
 (0)