Improve version test (use pkg_resources to compare versions). Also log failures to stderr.
--HG-- branch : pytest-2.7
This commit is contained in:
parent
b7d43c5a5d
commit
40a682476d
6
setup.py
6
setup.py
|
@ -29,8 +29,10 @@ def get_version():
|
||||||
def has_newish_setuptools():
|
def has_newish_setuptools():
|
||||||
try:
|
try:
|
||||||
import setuptools
|
import setuptools
|
||||||
return tuple(int(i) for i in str(setuptools.__version__).split('.')) > (0, 7)
|
import pkg_resources
|
||||||
except Exception:
|
return pkg_resources.parse_version(setuptools.__version__) >= pkg_resources.parse_version('0.7')
|
||||||
|
except Exception as exc:
|
||||||
|
sys.stderr.write("Could not test setuptool's version: %s\n" % exc)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue