Skip to content

Commit a5752e7

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

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-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: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,19 @@
99
import subprocess
1010

1111

12+
import os
13+
import subprocess
14+
15+
1216
def main():
13-
major = 3
14-
minor = 15
17+
base_dir = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir))
18+
base_version_file = os.path.join(base_dir, "BASE_VERSION")
19+
20+
with open(base_version_file, "r") as file:
21+
base_version = file.read().strip()
22+
23+
major, minor = map(int, base_version.split(".")[:2])
24+
1525
try:
1626
commit_count = (
1727
subprocess.check_output(["git", "rev-list", "--count", "HEAD"])
@@ -21,11 +31,7 @@ def main():
2131
except Exception:
2232
commit_count = "0"
2333

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

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

0 commit comments

Comments
 (0)