Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from os.path import isfile, join
import re
import logging
import sys
from setuptools import setup, find_packages

logging.basicConfig(level=logging.WARNING)
Expand Down Expand Up @@ -40,6 +41,13 @@

extras_require["test"] = tests_require

# Check for 'pytest-runner' only if setup.py was invoked with 'test'.
# This optimizes setup.py for cases when pytest-runner is not needed,
# using the approach that is suggested upstream.
#
# See https://pypi.org/project/pytest-runner/#conditional-requirement
needs_pytest = {"pytest", "test", "ptr"}.intersection(sys.argv)
pytest_runner = ["pytest-runner"] if needs_pytest else []

setup(
# Description
Expand Down Expand Up @@ -96,7 +104,7 @@
'windows-curses;platform_system=="Windows"',
"filelock",
],
setup_requires=["pytest-runner"],
setup_requires=pytest_runner,
extras_require=extras_require,
tests_require=tests_require,
)