diff options
-rw-r--r-- | CHANGES.rst | 7 | ||||
-rw-r--r-- | ptr.py | 14 |
2 files changed, 21 insertions, 0 deletions
diff --git a/CHANGES.rst b/CHANGES.rst index 02d5618..0ae8d37 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,10 @@ +4.4 +=== + +* #43: Detect condition where declarative config will cause + errors and emit a UserWarning with guidance on necessary + actions. + 4.3.1 ===== @@ -8,6 +8,7 @@ import contextlib as _contextlib import sys as _sys import operator as _operator import itertools as _itertools +import warnings as _warnings try: # ensure that map has the same meaning on Python 2 @@ -153,11 +154,24 @@ class PyTest(orig.test): results = list(map(dist.fetch_build_eggs, matching_extras)) return _itertools.chain.from_iterable(results) + @staticmethod + def _warn_old_setuptools(): + msg = ( + "pytest-runner will stop working on this version of setuptools; " + "please upgrade to setuptools 30.4 or later or pin to " + "pytest-runner < 5." + ) + ver_str = pkg_resources.get_distribution('setuptools').version + ver = pkg_resources.parse_version(ver_str) + if ver < pkg_resources.parse_version('30.4'): + _warnings.warn(msg) + def run(self): """ Override run to ensure requirements are available in this session (but don't install them anywhere). """ + self._warn_old_setuptools() dist = CustomizedDist() for attr in 'allow_hosts index_url'.split(): setattr(dist, attr, getattr(self, attr)) |