summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2016-12-09 18:00:58 +0000
committerRichard van der Hoff <richard@matrix.org>2016-12-09 18:00:58 +0000
commite721a7f2c19fd8804cbfca61b489d3180bd6df74 (patch)
tree95030b17f10714b68a993fedd8c3a8eb65e17d72
parentDon't try to run tox from setup.py (diff)
downloadsynapse-e721a7f2c19fd8804cbfca61b489d3180bd6df74.tar.xz
Implement a null 'test' command
Diffstat (limited to '')
-rwxr-xr-xsetup.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index 7e276f1678..b00c2af367 100755
--- a/setup.py
+++ b/setup.py
@@ -16,10 +16,13 @@
 
 import glob
 import os
-from setuptools import setup, find_packages
+from setuptools import setup, find_packages, Command
 import sys
 
 
+here = os.path.abspath(os.path.dirname(__file__))
+
+
 # Some notes on `setup.py test`:
 #
 # Once upon a time we used to try to make `setup.py test` run `tox` to run the
@@ -45,10 +48,19 @@ import sys
 #
 # [1]: http://tox.readthedocs.io/en/2.5.0/example/basic.html#integration-with-setup-py-test-command
 # [2]: https://pypi.python.org/pypi/setuptools_trial
+class TestCommand(Command):
+    user_options = []
 
+    def initialize_options(self):
+        pass
 
-here = os.path.abspath(os.path.dirname(__file__))
+    def finalize_options(self):
+        pass
 
+    def run(self):
+        print ("""Synapse's tests cannot be run via setup.py. To run them, try:
+     PYTHONPATH="." trial tests
+""")
 
 def read_file(path_segments):
     """Read a file from the package. Takes a list of strings to join to
@@ -81,4 +93,5 @@ setup(
     zip_safe=False,
     long_description=long_description,
     scripts=["synctl"] + glob.glob("scripts/*"),
+    cmdclass={'test': TestCommand},
 )