From 6f12789a398a99fc39e4380bd063af841a262c62 Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Sun, 16 Nov 2014 10:19:00 +1300 Subject: [PATCH] Fix setup.py to work without six installed. Sadly setup_requires is evil, but what are we doing to do? Change-Id: I4c7ac659c73dc51cf213763a79c9b38e621a8d45 --- .travis.yml | 4 ++-- NEWS | 4 ++++ setup.py | 19 ++++++++++++------- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3b21bee..09c6fc3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,8 +19,8 @@ matrix: env: JINJA_REQ="jinja2<2.7, Pygments<2.0" install: - - pip install -q --use-mirrors fixtures extras python-mimeparse $JINJA_REQ sphinx unittest2 - - python setup.py -q install + - pip install fixtures $JINJA_REQ sphinx + - python setup.py install script: - python -m testtools.run testtools.tests.test_suite diff --git a/NEWS b/NEWS index 88348c0..07a69f0 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,10 @@ NEXT Changes ------- +* Fixed our setup.py to use setup_requires to ensure the import dependencies + for testtools are present before setup.py runs (as setup.py imports testtools + to read out the version number). (Robert Collins) + * Support setUpClass skipping with self.skipException. Previously this worked with unittest from 2.7 and above but was not supported by testtools - it was a happy accident. Since we now hard depend on unittest2, we need to invert diff --git a/setup.py b/setup.py index a6c3e18..95c3b67 100755 --- a/setup.py +++ b/setup.py @@ -56,6 +56,16 @@ def get_long_description(): os.path.dirname(__file__), 'doc/overview.rst') return open(manual_path).read() +# Since we import testtools in setup.py, our setup requirements are our install +# requirements. +deps = [ + 'extras', + # 'mimeparse' has not been uploaded by the maintainer with Python3 compat + # but someone kindly uploaded a fixed version as 'python-mimeparse'. + 'python-mimeparse', + 'unittest2>=0.8.0', + ] + setup(name='testtools', author='Jonathan M. Lange', @@ -77,11 +87,6 @@ setup(name='testtools', ], cmdclass=cmd_class, zip_safe=False, - install_requires=[ - 'extras', - # 'mimeparse' has not been uploaded by the maintainer with Python3 compat - # but someone kindly uploaded a fixed version as 'python-mimeparse'. - 'python-mimeparse', - 'unittest2>=0.8.0', - ], + install_requires=deps, + setup_requires=deps, )