Rename function and add nice docstring.

--HG--
branch : pytest-2.7
This commit is contained in:
Ionel Cristian Maries 2015-04-10 22:11:17 +03:00
parent edd6c0f9b3
commit db08dcab14
1 changed files with 13 additions and 2 deletions

View File

@ -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: