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

Commit 2595075

Browse files
authored
Require pytest-runner only when testing (#637)
1 parent 73eb398 commit 2595075

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ def run(self):
173173
check_call(cmd, shell=True)
174174

175175

176+
NEEDS_PYTEST = {'pytest', 'test', 'coverage'}.intersection(sys.argv)
177+
PYTEST_RUNNER = ['pytest-runner'] if NEEDS_PYTEST else []
178+
176179
setup(name='python-openflow',
177180
version=__version__,
178181
description='Library to parse and generate OpenFlow messages',
@@ -183,7 +186,7 @@ def run(self):
183186
license='MIT',
184187
test_suite='tests',
185188
include_package_data=True,
186-
setup_requires=['pytest-runner'],
189+
setup_requires=PYTEST_RUNNER,
187190
tests_require=['pytest'],
188191
extras_require={'dev': ['pip-tools >= 2.0',
189192
'coverage', 'pytest', 'yala', 'tox']},

0 commit comments

Comments
 (0)