Skip to content

Commit d155125

Browse files
authored
Merge pull request docker-library#17446 from infosiftr/test-setuptools-wheel
Test that setuptools and wheel are installed (or not)
2 parents 4f71001 + ffb429e commit d155125

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test/tests/python-imports/container.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import platform
1+
import platform, sys
22

33
isWindows = platform.system() == 'Windows'
44
isNotPypy = platform.python_implementation() != 'PyPy'
5-
isCaveman = platform.python_version_tuple()[0] == '2'
5+
isCaveman = sys.version_info[0] == 2
66

77
if not isWindows:
88
import curses
@@ -23,3 +23,11 @@
2323
if not isCaveman:
2424
import lzma
2525
assert(lzma.decompress(lzma.compress(b'IT WORKS IT WORKS IT WORKS')) == b'IT WORKS IT WORKS IT WORKS')
26+
27+
# https://github.com/docker-library/python/pull/954
28+
shouldHaveSetuptoolsAndWheel = sys.version_info[0] == 3 and sys.version_info[1] < 12
29+
import importlib.util
30+
hasSetuptools = importlib.util.find_spec('setuptools') is not None
31+
hasWheel = importlib.util.find_spec('wheel') is not None
32+
assert(hasSetuptools == shouldHaveSetuptoolsAndWheel)
33+
assert(hasWheel == shouldHaveSetuptoolsAndWheel)

0 commit comments

Comments
 (0)