Browse code

get version in setup.py using version.get_version()

Bas Nijholt authored on 21/02/2018 14:37:34
Showing 2 changed files
... ...
@@ -16,10 +16,6 @@ distr_root = os.path.dirname(package_root)
16 16
 
17 17
 STATIC_VERSION_FILE = '_static_version.py'
18 18
 
19
-version = None
20
-
21
-package_name = 'adaptive'
22
-
23 19
 
24 20
 def write_version(fname, version):
25 21
     # This could be a hard link, so try to delete it first.  Is there any way
... ...
@@ -161,5 +157,3 @@ def cmdclass(version, package_name):
161 157
                           version=version)
162 158
 
163 159
     return dict(sdist=sdist, build=build)
164
-
165
-version = get_version()
... ...
@@ -21,8 +21,9 @@ def load_version_module(package_name):
21 21
     return module
22 22
 
23 23
 
24
-version = load_version_module('adaptive')
25
-cmdclass = version.cmdclass(version.version, 'adaptive')
24
+version_module = load_version_module('adaptive')
25
+version = version_module.get_version()
26
+cmdclass = version_module.cmdclass(version, 'adaptive')
26 27
 
27 28
 install_requires = [
28 29
     'scipy',
... ...
@@ -45,7 +46,7 @@ extras_require = {
45 46
 setup(
46 47
     name='adaptive',
47 48
     description='Adaptive parallel sampling of mathematical functions',
48
-    version=version.version,
49
+    version=version,
49 50
     url='https://gitlab.kwant-project.org/qt/adaptive',
50 51
     author='Adaptive authors',
51 52
     license='BSD',