Don't install pytest-runner when not needed

This commit is contained in:
Guillaume Ayoub 2016-08-05 16:22:55 +02:00
parent 50438bc2c0
commit 294eb5aa15

View File

@ -45,6 +45,9 @@ with open(init_path, "r", encoding="utf-8") as fd:
version = re.search('VERSION = "([^"]+)"', fd.read().strip()).group(1) version = re.search('VERSION = "([^"]+)"', fd.read().strip()).group(1)
needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
pytest_runner = ['pytest-runner'] if needs_pytest else []
# When the version is updated, ``radicale.VERSION`` must be modified. # When the version is updated, ``radicale.VERSION`` must be modified.
# A new section in the ``NEWS`` file must be added too. # A new section in the ``NEWS`` file must be added too.
setup( setup(
@ -63,12 +66,11 @@ setup(
provides=["radicale"], provides=["radicale"],
scripts=["bin/radicale"], scripts=["bin/radicale"],
install_requires=["vobject", "atomicwrites"], install_requires=["vobject", "atomicwrites"],
setup_requires=["pytest-runner"], setup_requires=pytest_runner,
tests_require=["pytest-cov", "pytest-flake8", "pytest-isort", "pytest"], tests_require=[
extras_require={ "pytest-runner", "pytest-cov", "pytest-flake8", "pytest-isort"],
"test": [ extras_require={"test": [
"pytest-runner", "pytest-cov", "pytest-flake8", "pytest-isort", "pytest-runner", "pytest-cov", "pytest-flake8", "pytest-isort"]}
"pytest"]},
keywords=["calendar", "addressbook", "CalDAV", "CardDAV"], keywords=["calendar", "addressbook", "CalDAV", "CardDAV"],
classifiers=[ classifiers=[
"Development Status :: 5 - Production/Stable", "Development Status :: 5 - Production/Stable",