summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-08-26 12:59:02 +0100
committerMark Haines <mark.haines@matrix.org>2015-08-26 12:59:02 +0100
commitfd246fde8934f1461589df20efcf53ae1bd0e90d (patch)
tree1fc1b9a4d702865ff2455b493c438c61ae01f91a
parentMake 'setup.py test' run tox (diff)
downloadsynapse-fd246fde8934f1461589df20efcf53ae1bd0e90d.tar.xz
Install tox locally if it wasn't already installed when running setup.py test
Diffstat (limited to '')
-rwxr-xr-xsetup.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index adc3316928..4a7b3c99aa 100755
--- a/setup.py
+++ b/setup.py
@@ -51,7 +51,16 @@ class Tox(Command):
 
     def run(self):
         #import here, cause outside the eggs aren't loaded
-        import tox
+        try:
+            import tox
+        except ImportError:
+            try:
+                self.distribution.fetch_build_eggs("tox")
+                import tox
+            except:
+                raise RuntimeError(
+                    "The tests need 'tox' to run. Please install 'tox'."
+                )
         import shlex
         args = self.tox_args
         if args:
@@ -75,6 +84,5 @@ setup(
     zip_safe=False,
     long_description=long_description,
     scripts=["synctl"] + glob.glob("scripts/*"),
-    tests_require=['tox'],
     cmdclass={'test': Tox},
 )