From 294eb5aa1543efe3cb1372342add05a602dc1ec2 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Fri, 5 Aug 2016 16:22:55 +0200 Subject: [PATCH] Don't install pytest-runner when not needed --- setup.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index c4e48406..5a0adebe 100755 --- a/setup.py +++ b/setup.py @@ -45,6 +45,9 @@ with open(init_path, "r", encoding="utf-8") as fd: 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. # A new section in the ``NEWS`` file must be added too. setup( @@ -63,12 +66,11 @@ setup( provides=["radicale"], scripts=["bin/radicale"], install_requires=["vobject", "atomicwrites"], - setup_requires=["pytest-runner"], - tests_require=["pytest-cov", "pytest-flake8", "pytest-isort", "pytest"], - extras_require={ - "test": [ - "pytest-runner", "pytest-cov", "pytest-flake8", "pytest-isort", - "pytest"]}, + setup_requires=pytest_runner, + tests_require=[ + "pytest-runner", "pytest-cov", "pytest-flake8", "pytest-isort"], + extras_require={"test": [ + "pytest-runner", "pytest-cov", "pytest-flake8", "pytest-isort"]} keywords=["calendar", "addressbook", "CalDAV", "CardDAV"], classifiers=[ "Development Status :: 5 - Production/Stable",