summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-06-21 15:41:09 -0300
committerTomás Touceda <chiiph@leap.se>2013-06-21 15:41:09 -0300
commit1a3a708482e442c18613637e04eed54c3418f060 (patch)
treeec4a816eb2833646593d39b9cabba8e2a7054055 /setup.py
parent4cfe344fceb16d19936fa8d0d2f6bdaa7e747740 (diff)
parent9557edfad010411b284a6a9cbb30390cff2002d8 (diff)
Merge remote-tracking branch 'kali/bug/fix_version' into develop
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py47
1 files changed, 18 insertions, 29 deletions
diff --git a/setup.py b/setup.py
index 7554c7dd..4b39189c 100755
--- a/setup.py
+++ b/setup.py
@@ -54,8 +54,6 @@ parsed_reqs = utils.parse_requirements()
cmdclass = versioneer.get_cmdclass()
leap_launcher = 'leap-client=leap.app:main'
-from distutils.command.build import build as _build
-from distutils.command.sdist import sdist as _sdist
from setuptools.command.develop import develop as _develop
@@ -66,27 +64,11 @@ def copy_reqs(path, withsrc=False):
reqsfile = os.path.join(path, 'src', *_reqpath)
else:
reqsfile = os.path.join(path, *_reqpath)
-
print("UPDATING %s" % reqsfile)
-
if os.path.isfile(reqsfile):
os.unlink(reqsfile)
- f = open(reqsfile, "w")
- f.write('\n'.join(parsed_reqs))
- f.close()
-
-
-class cmd_build(_build):
- def run(self):
- # versioneer:
- versions = versioneer.get_versions(verbose=True)
- self._versioneer_generated_versions = versions
- # unless we update this, the command will keep using the old version
- self.distribution.metadata.version = versions["version"]
-
- _build.run(self)
- copy_reqs(self.build_lib)
-
+ with open(reqsfile, "w") as f:
+ f.write('\n'.join(parsed_reqs))
class cmd_develop(_develop):
def run(self):
@@ -99,24 +81,31 @@ class cmd_develop(_develop):
_develop.run(self)
copy_reqs(self.egg_path)
+cmdclass["develop"] = cmd_develop
-class cmd_sdist(_sdist):
+# next two classes need to augment the versioneer modified ones
+
+versioneer_build = cmdclass['build']
+versioneer_sdist = cmdclass['sdist']
+
+
+class cmd_build(versioneer_build):
def run(self):
- # versioneer:
- versions = versioneer.get_versions(verbose=True)
- self._versioneer_generated_versions = versions
- # unless we update this, the command will keep using the old version
- self.distribution.metadata.version = versions["version"]
- return _sdist.run(self)
+ versioneer_build.run(self)
+ copy_reqs(self.build_lib)
+
+
+class cmd_sdist(versioneer_sdist):
+ def run(self):
+ return versioneer_sdist.run(self)
def make_release_tree(self, base_dir, files):
- _sdist.make_release_tree(self, base_dir, files)
+ versioneer_sdist.make_release_tree(self, base_dir, files)
copy_reqs(base_dir, withsrc=True)
cmdclass["build"] = cmd_build
cmdclass["sdist"] = cmd_sdist
-cmdclass["develop"] = cmd_develop
setup(