From cb8bca730249911f9e186e4e9caeba01e5349bfa Mon Sep 17 00:00:00 2001 From: Kubilay Kocak Date: Fri, 20 Dec 2019 11:54:01 +0000 Subject: [PATCH 1/2] Make pytest-runner conditional pytest runner should not be unconditionally included in setup_requires This change makes it conditional on setup.py invocation arguments as recommended upstream [1] See: https://github.com/pytest-dev/pytest/issues/3814 [1] https://pytest-runner.readthedocs.io/en/latest/#conditional-requirement --- setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 90217152..ab36ea4d 100644 --- a/setup.py +++ b/setup.py @@ -8,8 +8,11 @@ 'msgpack>=0.5.0', ] +needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv) +pytest_runner = ['pytest-runner'] if needs_pytest else [] + setup_requires = [ - 'pytest-runner' + pytest_runner, ] tests_require = [ From e7fac2f234e7df573ee8507002138447575fdcd5 Mon Sep 17 00:00:00 2001 From: Kubilay Kocak Date: Fri, 20 Dec 2019 12:12:55 +0000 Subject: [PATCH 2/2] Move pytest_runner list outside of setup_sequires --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index ab36ea4d..5ee9cd74 100644 --- a/setup.py +++ b/setup.py @@ -12,8 +12,7 @@ pytest_runner = ['pytest-runner'] if needs_pytest else [] setup_requires = [ - pytest_runner, -] +] + pytest_runner, tests_require = [ 'pytest>=3.4.0',