From 2357cb427f2344e3fbe726882d320913c3143ae6 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Wed, 24 Dec 2014 11:00:00 -0500 Subject: [PATCH 1/4] correction for setup version string detection --- tools/setupHelpers.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tools/setupHelpers.py b/tools/setupHelpers.py index b308b2261b..ef711b842e 100644 --- a/tools/setupHelpers.py +++ b/tools/setupHelpers.py @@ -360,12 +360,9 @@ def getGitVersion(tagPrefix): # Find last tag matching "tagPrefix.*" tagNames = check_output(['git', 'tag'], universal_newlines=True).strip().split('\n') - while True: - if len(tagNames) == 0: - raise Exception("Could not determine last tagged version.") - lastTagName = tagNames.pop() - if re.match(tagPrefix+r'\d+\.\d+.*', lastTagName): - break + tagNames = [x for x in tagNames if re.match(tagPrefix + r'\d+\.\d+\..*', x)] + tagNames.sort(key=lambda s: map(int, s[len(tagPrefix):].split('.'))) + lastTagName = tagNames[-1] gitVersion = lastTagName.replace(tagPrefix, '') # is this commit an unchanged checkout of the last tagged version? From 305dc7468e142d8d2756686664ca0b388d6448c0 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Wed, 24 Dec 2014 11:05:05 -0500 Subject: [PATCH 2/4] manifest corrections --- MANIFEST.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 86ae0f60c5..9b3331b342 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,7 +1,6 @@ -recursive-include pyqtgraph *.py *.ui *.m README *.txt -recursive-include tests *.py *.ui +recursive-include pyqtgraph *.py *.ui *.m README.* *.txt recursive-include examples *.py *.ui *.gz *.cfg -recursive-include doc *.rst *.py *.svg *.png *.jpg +recursive-include doc *.rst *.py *.svg *.png recursive-include doc/build/html * recursive-include tools * include doc/Makefile doc/make.bat README.md LICENSE.txt CHANGELOG From 9a15b557060543e56bebe72b5dc6657e1152996d Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Wed, 24 Dec 2014 11:19:42 -0500 Subject: [PATCH 3/4] Correct setup to use new setuptools if it is available --- setup.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/setup.py b/setup.py index 4c1a6acae6..d31ec82c49 100644 --- a/setup.py +++ b/setup.py @@ -34,14 +34,18 @@ ) -from distutils.core import setup import distutils.dir_util import os, sys, re try: - # just avoids warning about install_requires import setuptools + from setuptools import setup + from setuptools.command import build + from setuptools.command import install except ImportError: - pass + from distutils.core import setup + from distutils.command import build + from distutils.command import install + path = os.path.split(__file__)[0] sys.path.insert(0, os.path.join(path, 'tools')) @@ -55,9 +59,8 @@ version, forcedVersion, gitVersion, initVersion = helpers.getVersionStrings(pkg='pyqtgraph') -import distutils.command.build -class Build(distutils.command.build.build): +class Build(build.build): """ * Clear build path before building * Set version string in __init__ after building @@ -71,7 +74,7 @@ def run(self): if os.path.isdir(buildPath): distutils.dir_util.remove_tree(buildPath) - ret = distutils.command.build.build.run(self) + ret = build.build.run(self) # If the version in __init__ is different from the automatically-generated # version string, then we will update __init__ in the build directory @@ -94,9 +97,8 @@ def run(self): sys.excepthook(*sys.exc_info()) return ret -import distutils.command.install -class Install(distutils.command.install.install): +class Install(install.install): """ * Check for previously-installed version before installing """ @@ -108,7 +110,8 @@ def run(self): "installed at %s; remove this before installing." % (name, path)) print("Installing to %s" % path) - return distutils.command.install.install.run(self) + return install.install.run(self) + setup( version=version, From e8820667f036450123cab48f4aeee314a0988b62 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Wed, 24 Dec 2014 12:06:40 -0500 Subject: [PATCH 4/4] setup correction --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index d31ec82c49..7ca1be2657 100644 --- a/setup.py +++ b/setup.py @@ -35,15 +35,14 @@ import distutils.dir_util +from distutils.command import build import os, sys, re try: import setuptools from setuptools import setup - from setuptools.command import build from setuptools.command import install except ImportError: from distutils.core import setup - from distutils.command import build from distutils.command import install