We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6b46e86 commit 2d74ccbCopy full SHA for 2d74ccb
docs/install_pyopenms.py
@@ -10,13 +10,13 @@
10
11
def get_version_from_conf():
12
"""Extract version from docs/source/conf.py"""
13
- conf_path = Path(__file__).parent / "source" / "conf.py"
+ conf_path = Path(__file__).parent.resolve() / "source" / "conf.py"
14
15
- with open(conf_path, 'r') as f:
+ with open(conf_path, 'r', encoding='utf-8') as f:
16
content = f.read()
17
18
- # Look for version = u'X.Y.Z' pattern
19
- match = re.search(r"version\s*=\s*u?['\"]([^'\"]+)['\"]", content)
+ # Look for version = u'X.Y.Z' pattern (with word boundary to be more specific)
+ match = re.search(r"\bversion\s*=\s*u?['\"]([^'\"]+)['\"]", content)
20
21
if match:
22
version = match.group(1)
0 commit comments