Fix setup.py to work without six installed.

Sadly setup_requires is evil, but what are we doing to do?

Change-Id: I4c7ac659c73dc51cf213763a79c9b38e621a8d45
This commit is contained in:
Robert Collins
2014-11-16 10:19:00 +13:00
parent 1a713d118a
commit 6f12789a39
3 changed files with 18 additions and 9 deletions

View File

@@ -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

4
NEWS
View File

@@ -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

View File

@@ -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,
)