Skip to content

Commit 4326e75

Browse files
committed
remove suffix added by fork build process when setting ONNX required version
1 parent 4a716a0 commit 4326e75

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

setup.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616
# For user, we install the onnx release known to work with our release.
1717
with open(os.path.join(TOP_DIR, 'ONNX_VERSION_NUMBER')) as onnx_version_file:
1818
onnx_version = onnx_version_file.read().strip()
19-
onnx_dep = "onnx>=" + onnx_version
20-
# For ONNX 1.9.0 for the Bonsai fork we need to use ONNX 1.9.0
21-
# since we don't have an internal ONNX fork and the onnx_version above
22-
# will be the one generated by the build process (1.9.0.xxxx), which
23-
# does not exist in the ONNX repo
24-
if onnx_version.startswith("1.9.0"):
25-
onnx_dep = "onnx==1.9.0"
19+
# see if our build process has added a suffix to the version
20+
n_dots = [i for i, letter in enumerate(s) if letter == "."]
2621

22+
# get the ONNX version from the upstream repo
23+
# by removing the suffix appended by the Fork build process
24+
if len(n_dots) == 3:
25+
onnx_version = onnx_version[0:n_dots[-1]]
26+
27+
onnx_dep = "onnx==" + onnx_version
2728
try:
2829
git_version = subprocess.check_output(['git', 'rev-parse', 'HEAD'],
2930
cwd=TOP_DIR).decode('ascii').strip()

0 commit comments

Comments
 (0)