Skip to content

Commit

Permalink
dist: Make pytest-runner conditional #418
Browse files Browse the repository at this point in the history
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
  • Loading branch information
koobs authored and justinmk committed Jan 10, 2020
1 parent 588b1f7 commit f048531
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +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 = [
'pytest>=3.4.0',
Expand Down

0 comments on commit f048531

Please sign in to comment.