Skip to content

Commit f048531

Browse files
koobsjustinmk
authored andcommitted
dist: Make pytest-runner conditional #418
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: pytest-dev/pytest#3814 Identified via: [FreeBSD Ports Bug 242065](https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242065) Closes #417 Closes #420 [1] https://pytest-runner.readthedocs.io/en/latest/#conditional-requirement
1 parent 588b1f7 commit f048531

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
'msgpack>=0.5.0',
99
]
1010

11+
needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
12+
pytest_runner = ['pytest-runner'] if needs_pytest else []
13+
1114
setup_requires = [
12-
'pytest-runner'
13-
]
15+
] + pytest_runner,
1416

1517
tests_require = [
1618
'pytest>=3.4.0',

0 commit comments

Comments
 (0)