diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2019-02-14 08:44:53 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2019-02-14 08:44:53 -0500 |
commit | 1bfab3a9b1cc68a3c8a2722fe1a7522ddc61ec2e (patch) | |
tree | a754429a2cd99b654e0c698e146f1b46ad146ab5 | |
parent | 2913cd2fb01ad77947411680d9b1fbf0a5eae69e (diff) | |
parent | b2202f5aee77d3a764154d89a56579da83232282 (diff) | |
download | pytest-runner-1bfab3a9b1cc68a3c8a2722fe1a7522ddc61ec2e.tar.gz |
Merge branch '4.x'
-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 6693e0a..76eba1f 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)) |