From db08dcab143a70876ac09f2a87d4f7adc9428461 Mon Sep 17 00:00:00 2001 From: Ionel Cristian Maries Date: Fri, 10 Apr 2015 22:11:17 +0300 Subject: [PATCH] Rename function and add nice docstring. --HG-- branch : pytest-2.7 --- setup.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 4225d22c2..e9f1fb54a 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,18 @@ def get_version(): raise ValueError("could not read version") -def has_newish_setuptools(): +def has_environment_marker_support(): + """ + Tests that setuptools has support for PEP-426 environment marker support. + + The first known release to support it is 0.7 (and the earliest on PyPI seems to be 0.7.2 + so we're using that), see: http://pythonhosted.org/setuptools/history.html#id142 + + References: + + * https://wheel.readthedocs.org/en/latest/index.html#defining-conditional-dependencies + * https://www.python.org/dev/peps/pep-0426/#environment-markers + """ try: import setuptools import pkg_resources @@ -39,7 +50,7 @@ def has_newish_setuptools(): def main(): install_requires = ['py>=1.4.25'] extras_require = {} - if has_newish_setuptools(): + if has_environment_marker_support(): extras_require[':python_version=="2.6" or python_version=="3.0" or python_version=="3.1"'] = ['argparse'] extras_require[':sys_platform=="win32"'] = ['colorama'] else: