Skip to content

Commit

Permalink
Make pytest-runner an optional dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
jwiggins committed Jul 20, 2017
1 parent 9967fb7 commit cf1c36f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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': [
Expand Down

0 comments on commit cf1c36f

Please sign in to comment.