Skip to content

Commit

Permalink
Make pytest-runner a conditional requirement
Browse files Browse the repository at this point in the history
Check for pytest-runner only if setup.py was invoked with 'test'
argument.
  • Loading branch information
thombashi committed Jun 19, 2016
1 parent 5b6784e commit 63fe493
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
from __future__ import with_statement
import sys
import os.path
import setuptools


REQUIREMENT_DIR = "requirements"

needs_pytest = set(['pytest', 'test', 'ptr']).intersection(sys.argv)
pytest_runner = ['pytest-runner'] if needs_pytest else []

with open("README.rst") as fp:
long_description = fp.read()

Expand Down Expand Up @@ -33,7 +36,7 @@
],
long_description=long_description,
packages=setuptools.find_packages(exclude=['test*']),
setup_requires=["pytest-runner"],
setup_requires=pytest_runner,
tests_require=tests_require,
classifiers=[
"Development Status :: 4 - Beta",
Expand Down

0 comments on commit 63fe493

Please sign in to comment.