Skip to content

Commit 5f5b173

Browse files
[3.13] gh-132415: Update vendored setuptools in Lib/test/wheeldata (GH-132887) (#135391)
(cherry picked from commit c9f3f5b) Co-authored-by: Adam Turner <[email protected]>
1 parent 6901988 commit 5f5b173

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

Lib/test/support/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2386,7 +2386,7 @@ def _findwheel(pkgname):
23862386
filenames = os.listdir(wheel_dir)
23872387
filenames = sorted(filenames, reverse=True) # approximate "newest" first
23882388
for filename in filenames:
2389-
# filename is like 'setuptools-67.6.1-py3-none-any.whl'
2389+
# filename is like 'setuptools-{version}-py3-none-any.whl'
23902390
if not filename.endswith(".whl"):
23912391
continue
23922392
prefix = pkgname + '-'
@@ -2395,16 +2395,16 @@ def _findwheel(pkgname):
23952395
raise FileNotFoundError(f"No wheel for {pkgname} found in {wheel_dir}")
23962396

23972397

2398-
# Context manager that creates a virtual environment, install setuptools and wheel in it
2399-
# and returns the path to the venv directory and the path to the python executable
2398+
# Context manager that creates a virtual environment, install setuptools in it,
2399+
# and returns the paths to the venv directory and the python executable
24002400
@contextlib.contextmanager
2401-
def setup_venv_with_pip_setuptools_wheel(venv_dir):
2402-
import shlex
2401+
def setup_venv_with_pip_setuptools(venv_dir):
24032402
import subprocess
24042403
from .os_helper import temp_cwd
24052404

24062405
def run_command(cmd):
24072406
if verbose:
2407+
import shlex
24082408
print()
24092409
print('Run:', ' '.join(map(shlex.quote, cmd)))
24102410
subprocess.run(cmd, check=True)
@@ -2428,10 +2428,10 @@ def run_command(cmd):
24282428
else:
24292429
python = os.path.join(venv, 'bin', python_exe)
24302430

2431-
cmd = [python, '-X', 'dev',
2431+
cmd = (python, '-X', 'dev',
24322432
'-m', 'pip', 'install',
24332433
_findwheel('setuptools'),
2434-
_findwheel('wheel')]
2434+
)
24352435
run_command(cmd)
24362436

24372437
yield python

Lib/test/test_cext/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def test_build_limited_c11(self):
5050

5151
def check_build(self, extension_name, std=None, limited=False):
5252
venv_dir = 'env'
53-
with support.setup_venv_with_pip_setuptools_wheel(venv_dir) as python_exe:
53+
with support.setup_venv_with_pip_setuptools(venv_dir) as python_exe:
5454
self._check_build(extension_name, python_exe,
5555
std=std, limited=limited)
5656

Lib/test/test_cppext/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def test_build_limited(self):
4747

4848
def check_build(self, extension_name, std=None, limited=False):
4949
venv_dir = 'env'
50-
with support.setup_venv_with_pip_setuptools_wheel(venv_dir) as python_exe:
50+
with support.setup_venv_with_pip_setuptools(venv_dir) as python_exe:
5151
self._check_build(extension_name, python_exe,
5252
std=std, limited=limited)
5353

Lib/test/test_peg_generator/test_c_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def setUpClass(cls):
9999
cls.addClassCleanup(shutil.rmtree, cls.library_dir)
100100

101101
with contextlib.ExitStack() as stack:
102-
python_exe = stack.enter_context(support.setup_venv_with_pip_setuptools_wheel("venv"))
102+
python_exe = stack.enter_context(support.setup_venv_with_pip_setuptools("venv"))
103103
sitepackages = subprocess.check_output(
104104
[python_exe, "-c", "import sysconfig; print(sysconfig.get_path('platlib'))"],
105105
text=True,
Binary file not shown.
Binary file not shown.
-64.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)