Rename function and add nice docstring.
--HG-- branch : pytest-2.7
This commit is contained in:
parent
edd6c0f9b3
commit
db08dcab14
15
setup.py
15
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:
|
||||
|
|
Loading…
Reference in New Issue