def has_environment_marker_support():
#type: () -> bool
"""
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.io/en/latest/index.html#defining-conditional-dependencies
* https://www.python.org/dev/peps/pep-0426/#environment-markers
Method extended from pytest. Credit goes to developers there.
"""
try:
from pkg_resources import parse_version
return parse_version(setuptools.__version__) >= parse_version('0.7.2')
except Exception as exc:
sys.stderr.write("Could not test setuptool's version: %s\n" % exc)
return False
评论列表
文章目录