diff --git a/setup.py b/setup.py index c17065c..4a4833f 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,12 @@ # -*- coding: utf-8 -*- from __future__ import with_statement +import sys from setuptools import setup +needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv) +pytest_runner = ['pytest-runner'] if needs_pytest else [] + def get_version(fname='mccabe.py'): with open(fname) as f: @@ -33,7 +37,7 @@ def get_long_description(): license='Expat license', py_modules=['mccabe'], zip_safe=False, - setup_requires=['pytest-runner'], + setup_requires=pytest_runner, tests_require=['pytest'], entry_points={ 'flake8.extension': [