Skip to content

Commit f82fe73

Browse files
committed
Raise on install if Python < 3.8 requirements are not met. Refs #1692
1 parent 9f6cb64 commit f82fe73

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

setup.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,17 @@
2727
# like "setuptools; python_version < '3.8'" is not used here because
2828
# it breaks installation via "python setup.py install". See also the
2929
# discussion at: https://github.com/Supervisor/supervisor/issues/1692
30-
requires = []
3130
if py_version < (3, 8):
32-
requires.append("setuptools")
31+
try:
32+
import pkg_resources
33+
import setuptools
34+
except ImportError:
35+
raise RuntimeError(
36+
"On Python < 3.8, Supervisor requires setuptools as a runtime"
37+
" dependency because pkg_resources is used to load plugins"
38+
)
39+
40+
requires = []
3341

3442
tests_require = []
3543
testing_extras = tests_require + [

0 commit comments

Comments
 (0)