diff options
author | Enji Cooper <yaneurabeya@gmail.com> | 2019-11-14 13:35:15 -0800 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2019-11-16 21:21:15 +0100 |
commit | 39c6cdd61da9d398e47425579478da39e84b2e3a (patch) | |
tree | 1a56f5d1fc8781a30e13df039a76014438485c24 /setup.py | |
parent | 657fa7638b2884c622e61f3b06f8dba972550fb2 (diff) | |
download | astroid-git-39c6cdd61da9d398e47425579478da39e84b2e3a.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.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -12,6 +12,7 @@ # pylint: disable=W0404,W0622,W0613 """Setup script for astroid.""" import os +import sys from setuptools import find_packages, setup from setuptools.command import easy_install # pylint: disable=unused-import from setuptools.command import install_lib # pylint: disable=unused-import @@ -27,6 +28,9 @@ with open(os.path.join(astroid_dir, "README.rst")) as fobj: long_description = fobj.read() +needs_pytest = set(['pytest', 'test', 'ptr']).intersection(sys.argv) +pytest_runner = ['pytest-runner'] if needs_pytest else [] + def install(): return setup( name="astroid", @@ -42,7 +46,7 @@ def install(): install_requires=install_requires, extras_require=extras_require, packages=find_packages() + ["astroid.brain"], - setup_requires=["pytest-runner"], + setup_requires=pytest_runner, test_suite="test", tests_require=["pytest"], ) |