summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2018-03-18 08:57:05 -0400
committerJason R. Coombs <jaraco@jaraco.com>2018-03-18 08:57:05 -0400
commit8355b65ff6d3a15b3910f3a8c2c982f6a299b0e5 (patch)
treeeacbdb95bab0ef7892a3dad0a02fcc79734ffef6
parent1d547a0b0f85ebdc3d538d3e444a299d004b62a0 (diff)
downloadpytest-runner-8355b65ff6d3a15b3910f3a8c2c982f6a299b0e5.tar.gz
Moved dependency check to runtime. Fixes #40.4.2
-rw-r--r--CHANGES.rst6
-rw-r--r--ptr.py12
-rw-r--r--setup.py2
3 files changed, 19 insertions, 1 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index 37882ab..3fa11b9 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -1,3 +1,9 @@
+4.2
+===
+
+* #40: Remove declared dependency and instead assert it at
+ run time.
+
4.1
===
diff --git a/ptr.py b/ptr.py
index 9bf75c4..8122e20 100644
--- a/ptr.py
+++ b/ptr.py
@@ -93,6 +93,18 @@ class PyTest(orig.test):
self.index_url = None
self.allow_hosts = None
self.addopts = []
+ self.ensure_setuptools_version()
+
+ @staticmethod
+ def ensure_setuptools_version():
+ """
+ Due to the fact that pytest-runner is often required (via
+ setup-requires directive) by toolchains that never invoke
+ it (i.e. they're only installing the package, not testing it),
+ instead of declaring the dependency in the package
+ metadata, assert the requirement at run time.
+ """
+ pkg_resources.require('setuptools>=27.3')
def finalize_options(self):
if self.addopts:
diff --git a/setup.py b/setup.py
index f3cfe54..b72262c 100644
--- a/setup.py
+++ b/setup.py
@@ -32,7 +32,7 @@ params = dict(
py_modules=['ptr'],
python_requires='>=2.7,!=3.0,!=3.1',
install_requires=[
- 'setuptools>=27.3',
+ # setuptools 27.3 is required at run time
],
extras_require={
'testing': [