Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Implement a null 'test' command
Browse files Browse the repository at this point in the history
  • Loading branch information
richvdh committed Dec 9, 2016
1 parent af32d3b commit e721a7f
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions setup.py
Expand Up @@ -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
Expand All @@ -45,10 +48,19 @@
#
# [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
Expand Down Expand Up @@ -81,4 +93,5 @@ def exec_file(path_segments):
zip_safe=False,
long_description=long_description,
scripts=["synctl"] + glob.glob("scripts/*"),
cmdclass={'test': TestCommand},
)

0 comments on commit e721a7f

Please sign in to comment.