summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2018-02-10 15:24:39 -0500
committerJason R. Coombs <jaraco@jaraco.com>2018-02-10 15:24:39 -0500
commitac9482d95d48a66c80e2f10bdbf4e6cbef571c36 (patch)
treeb3f6832889412ca01d0e594eba93cbe0c570fbaa
parent86af5c21cd3391de595f23cdb61097591f75a9ba (diff)
downloadpytest-runner-ac9482d95d48a66c80e2f10bdbf4e6cbef571c36.tar.gz
Remove compatibility shims for Setuptools<27.3.0
-rw-r--r--CHANGES.rst2
-rw-r--r--ptr.py36
-rw-r--r--tests/test_ptr.py2
3 files changed, 5 insertions, 35 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index 09d1d5e..412a23b 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -1,7 +1,7 @@
4.0
===
-* Drop support for Setuptools before Setuptools 22.0.1.
+* Drop support for Setuptools before Setuptools 27.3.0.
3.0.1
=====
diff --git a/ptr.py b/ptr.py
index e270ff8..9bf75c4 100644
--- a/ptr.py
+++ b/ptr.py
@@ -31,11 +31,6 @@ def _save_argv(repl=None):
_sys.argv[:] = saved
-@_contextlib.contextmanager
-def null():
- yield
-
-
class CustomizedDist(Distribution):
allow_hosts = None
@@ -115,21 +110,14 @@ class PyTest(orig.test):
and pkg_resources.evaluate_marker(marker)
)
- @staticmethod
- def _install_dists_compat(dist):
- """
- Copy of install_dists from setuptools 27.3.0.
- """
- ir_d = dist.fetch_build_eggs(dist.install_requires or [])
- tr_d = dist.fetch_build_eggs(dist.tests_require or [])
- return _itertools.chain(ir_d, tr_d)
-
def install_dists(self, dist):
"""
Extend install_dists to include extras support
"""
- i_d = getattr(orig.test, 'install_dists', self._install_dists_compat)
- return _itertools.chain(i_d(dist), self.install_extra_dists(dist))
+ return _itertools.chain(
+ orig.test.install_dists(dist),
+ self.install_extra_dists(dist),
+ )
def install_extra_dists(self, dist):
"""
@@ -153,22 +141,6 @@ class PyTest(orig.test):
results = list(map(dist.fetch_build_eggs, matching_extras))
return _itertools.chain.from_iterable(results)
- @staticmethod
- def paths_on_pythonpath(paths):
- """
- Backward compatibility for paths_on_pythonpath;
- Returns a null context if paths_on_pythonpath is
- not implemented in orig.test.
- Note that this also means that the paths iterable
- is never consumed, which incidentally means that
- the None values from dist.fetch_build_eggs in
- older Setuptools will be disregarded.
- """
- try:
- return orig.test.paths_on_pythonpath(paths)
- except AttributeError:
- return null()
-
def run(self):
"""
Override run to ensure requirements are available in this session (but
diff --git a/tests/test_ptr.py b/tests/test_ptr.py
index fcbf0c5..a37b0e3 100644
--- a/tests/test_ptr.py
+++ b/tests/test_ptr.py
@@ -40,8 +40,6 @@ def venv(virtualenv):
@pytest.mark.parametrize('setuptools_req, test_args', (
- ('setuptools==27.2.0', ''),
- ('setuptools==27.2.0', '--extras'),
('setuptools==27.3.0', ''),
('setuptools==27.3.0', '--extras'),
('setuptools==32.3.1', ''),