Skip to content

Commit a731a7f

Browse files
authored
fix(build): fix version parse regex to support post-release versions (#3764)
* fix(build): fix version parse regex to support post-release versions * fix(build): make RelWithDebInfo as default CMAKE_BUILD_TYPE
1 parent 0dccd9f commit a731a7f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def readme():
2222

2323
def get_version():
2424
file_path = os.path.join(pwd, version_file)
25-
pattern = re.compile(r"\s*__version__\s*=\s*'(\d+\.\d+\.\d+)'")
25+
pattern = re.compile(r"\s*__version__\s*=\s*'([0-9A-Za-z.-]+)'")
2626
with open(file_path, 'r') as f:
2727
for line in f:
2828
m = pattern.match(line)
@@ -138,6 +138,7 @@ def gen_packages_items():
138138
'-DCALL_FROM_SETUP_PY:BOOL=ON',
139139
'-DBUILD_SHARED_LIBS:BOOL=OFF',
140140
# Select the bindings implementation
141+
'-DCMAKE_BUILD_TYPE=' + os.getenv('CMAKE_BUILD_TYPE', 'RelWithDebInfo'),
141142
'-DBUILD_PY_FFI=ON',
142143
'-DBUILD_MULTI_GPU=' + ('OFF' if os.name == 'nt' else 'ON'),
143144
'-DUSE_NVTX=' + ('OFF' if os.name == 'nt' else 'ON'),

0 commit comments

Comments
 (0)