We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 39a837b commit bc78fc1Copy full SHA for bc78fc1
setup.py
@@ -1,4 +1,6 @@
1
+import os
2
from setuptools import Extension, setup
3
+from setuptools_scm import get_version
4
5
ext_modules = [
6
Extension(
@@ -19,10 +21,19 @@
19
21
),
20
22
]
23
-
24
if __name__ == "__main__":
25
from Cython.Build import cythonize
26
27
+ version_file = os.path.join("src", "ruptures", "version.py")
28
+ if not os.path.exists(version_file):
29
+ version = get_version(root=".", relative_to=__file__)
30
+ if not version:
31
+ raise RuntimeError(
32
+ "Version could not be determined. Ensure you have a valid git tag."
33
+ )
34
+ with open(version_file, "w") as f:
35
+ f.write(f'__version__ = version = "{version}"\n')
36
+
37
setup(
38
ext_modules=cythonize(ext_modules, language_level="3"),
39
)
0 commit comments