From ed5f9363a2e53fe98709a8a4ff4cfc1660c8dbda Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Thu, 14 Nov 2019 11:15:37 -0800 Subject: Make installing pytest-runner contingent on running tests This monkeypatches several changes from [PyCQA/mccabe](https://github.com/PyCQA/mccabe/blob/master/setup.py) over to the pylint repo, since the pattern was equivalent between the two projects. Signed-off-by: Enji Cooper --- setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index b46d40917..3a98994ff 100644 --- a/setup.py +++ b/setup.py @@ -62,6 +62,10 @@ else: long_description = "" +needs_pytest = set(['pytest', 'test', 'ptr']).intersection(sys.argv) +pytest_runner = ['pytest-runner'] if needs_pytest else [] + + def ensure_scripts(linux_scripts): """Creates the proper script names required for each platform (taken from 4Suite) @@ -143,7 +147,7 @@ def install(**kwargs): extras_require=extras_require, test_suite="test", python_requires=">=3.5.*", - setup_requires=["pytest-runner"], + setup_requires=pytest_runner, tests_require=["pytest"], **kwargs ) -- cgit v1.2.1