Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit 8355b65

Browse files
committed
Moved dependency check to runtime. Fixes #40.
1 parent 1d547a0 commit 8355b65

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

CHANGES.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
4.2
2+
===
3+
4+
* #40: Remove declared dependency and instead assert it at
5+
run time.
6+
17
4.1
28
===
39

ptr.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,18 @@ def initialize_options(self):
9393
self.index_url = None
9494
self.allow_hosts = None
9595
self.addopts = []
96+
self.ensure_setuptools_version()
97+
98+
@staticmethod
99+
def ensure_setuptools_version():
100+
"""
101+
Due to the fact that pytest-runner is often required (via
102+
setup-requires directive) by toolchains that never invoke
103+
it (i.e. they're only installing the package, not testing it),
104+
instead of declaring the dependency in the package
105+
metadata, assert the requirement at run time.
106+
"""
107+
pkg_resources.require('setuptools>=27.3')
96108

97109
def finalize_options(self):
98110
if self.addopts:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
py_modules=['ptr'],
3333
python_requires='>=2.7,!=3.0,!=3.1',
3434
install_requires=[
35-
'setuptools>=27.3',
35+
# setuptools 27.3 is required at run time
3636
],
3737
extras_require={
3838
'testing': [

0 commit comments

Comments
 (0)