Skip to content

Commit c522f6e

Browse files
committed
00461: Downstream only: Install wheel in test venvs when setuptools < 71
1 parent 98f5001 commit c522f6e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Lib/test/support/__init__.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2329,9 +2329,18 @@ def setup_venv_with_pip_setuptools(venv_dir):
23292329
else:
23302330
python = os.path.join(venv, 'bin', python_exe)
23312331

2332+
setuptools_whl = _findwheel('setuptools')
2333+
whl_filename = os.path.basename(setuptools_whl)
2334+
setuptools_major = int(whl_filename.split('-')[1].split('.')[0])
2335+
if setuptools_major >= 71: # we need 70.1+, but that's OK
2336+
wheels = (setuptools_whl,)
2337+
else:
2338+
wheels = (setuptools_whl, _findwheel('wheel'))
2339+
23322340
cmd = (python, '-X', 'dev',
23332341
'-m', 'pip', 'install',
2334-
_findwheel('setuptools'))
2342+
*wheels,
2343+
)
23352344
if verbose:
23362345
print()
23372346
print('Run:', ' '.join(cmd))

0 commit comments

Comments
 (0)