summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorEnji Cooper <yaneurabeya@gmail.com>2019-11-14 11:15:37 -0800
committerClaudiu Popa <pcmanticore@gmail.com>2019-11-16 21:24:40 +0100
commited5f9363a2e53fe98709a8a4ff4cfc1660c8dbda (patch)
tree09bb447d732f8019138e1fb37c32c71626ea4eab /setup.py
parent1b15abbc5a995d57abe5f2a7016d6088355a2b91 (diff)
downloadpylint-git-ed5f9363a2e53fe98709a8a4ff4cfc1660c8dbda.tar.gz
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 <yaneurabeya@gmail.com>
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py6
1 files changed, 5 insertions, 1 deletions
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
)