Skip to content
Snippets Groups Projects
Commit 60d4b933 authored by Bernd Kuhls's avatar Bernd Kuhls Committed by Dan Michael O. Heggø
Browse files

setup.py: require pytest-runner only when necessary

This optimizes setup.py for cases when pytest-runner is not needed,
using the approach that is suggested upstream:

https://pypi.python.org/pypi/pytest-runner#conditional-requirement
parent cd86bf35
No related branches found
No related tags found
Loading
...@@ -8,6 +8,9 @@ from setuptools import setup ...@@ -8,6 +8,9 @@ from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__)) here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read() README = open(os.path.join(here, 'README.rst')).read()
needs_pytest = set(['pytest', 'test', 'ptr']).intersection(sys.argv)
pytest_runner = ['pytest-runner'] if needs_pytest else []
setup(name='mwclient', setup(name='mwclient',
version='0.8.6', # Use bumpversion to update version='0.8.6', # Use bumpversion to update
description='MediaWiki API client', description='MediaWiki API client',
...@@ -27,7 +30,7 @@ setup(name='mwclient', ...@@ -27,7 +30,7 @@ setup(name='mwclient',
license='MIT', license='MIT',
packages=['mwclient'], packages=['mwclient'],
install_requires=['requests_oauthlib', 'six'], install_requires=['requests_oauthlib', 'six'],
setup_requires=['pytest-runner'], setup_requires=pytest_runner,
tests_require=['pytest', 'pytest-pep8', 'pytest-cache', 'pytest-cov', tests_require=['pytest', 'pytest-pep8', 'pytest-cache', 'pytest-cov',
'responses>=0.3.0', 'responses!=0.6.0', 'mock'], 'responses>=0.3.0', 'responses!=0.6.0', 'mock'],
zip_safe=True zip_safe=True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment