diff --git a/setup.py b/setup.py index 452e4e54..e041a252 100755 --- a/setup.py +++ b/setup.py @@ -35,6 +35,9 @@ def get_version(package): 'pytest-runner', ] +needs_pytest = set(('pytest', 'test', 'ptr')).intersection(sys.argv) +pytest_runner = ['pytest-runner'] if needs_pytest else [] + setup( name='PyJWT', version=version, @@ -61,7 +64,7 @@ def get_version(package): 'Topic :: Utilities', ], test_suite='tests', - setup_requires=['pytest-runner'], + setup_requires=pytest_runner, tests_require=tests_require, extras_require=dict( test=tests_require,