Skip to content

Commit c9f3f5b

Browse files
authored
gh-132415: Update vendored setuptools in Lib/test/wheeldata (#132887)
1 parent 08e3389 commit c9f3f5b

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

Lib/test/support/__init__.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -2416,7 +2416,7 @@ def _findwheel(pkgname):
24162416
filenames = os.listdir(wheel_dir)
24172417
filenames = sorted(filenames, reverse=True) # approximate "newest" first
24182418
for filename in filenames:
2419-
# filename is like 'setuptools-67.6.1-py3-none-any.whl'
2419+
# filename is like 'setuptools-{version}-py3-none-any.whl'
24202420
if not filename.endswith(".whl"):
24212421
continue
24222422
prefix = pkgname + '-'
@@ -2425,16 +2425,16 @@ def _findwheel(pkgname):
24252425
raise FileNotFoundError(f"No wheel for {pkgname} found in {wheel_dir}")
24262426

24272427

2428-
# Context manager that creates a virtual environment, install setuptools and wheel in it
2429-
# and returns the path to the venv directory and the path to the python executable
2428+
# Context manager that creates a virtual environment, install setuptools in it,
2429+
# and returns the paths to the venv directory and the python executable
24302430
@contextlib.contextmanager
2431-
def setup_venv_with_pip_setuptools_wheel(venv_dir):
2432-
import shlex
2431+
def setup_venv_with_pip_setuptools(venv_dir):
24332432
import subprocess
24342433
from .os_helper import temp_cwd
24352434

24362435
def run_command(cmd):
24372436
if verbose:
2437+
import shlex
24382438
print()
24392439
print('Run:', ' '.join(map(shlex.quote, cmd)))
24402440
subprocess.run(cmd, check=True)
@@ -2458,10 +2458,10 @@ def run_command(cmd):
24582458
else:
24592459
python = os.path.join(venv, 'bin', python_exe)
24602460

2461-
cmd = [python, '-X', 'dev',
2461+
cmd = (python, '-X', 'dev',
24622462
'-m', 'pip', 'install',
24632463
_findwheel('setuptools'),
2464-
_findwheel('wheel')]
2464+
)
24652465
run_command(cmd)
24662466

24672467
yield python

Lib/test/test_cext/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def test_build_limited_c11(self):
5353

5454
def check_build(self, extension_name, std=None, limited=False):
5555
venv_dir = 'env'
56-
with support.setup_venv_with_pip_setuptools_wheel(venv_dir) as python_exe:
56+
with support.setup_venv_with_pip_setuptools(venv_dir) as python_exe:
5757
self._check_build(extension_name, python_exe,
5858
std=std, limited=limited)
5959

Lib/test/test_cppext/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def test_build_limited(self):
5454

5555
def check_build(self, extension_name, std=None, limited=False):
5656
venv_dir = 'env'
57-
with support.setup_venv_with_pip_setuptools_wheel(venv_dir) as python_exe:
57+
with support.setup_venv_with_pip_setuptools(venv_dir) as python_exe:
5858
self._check_build(extension_name, python_exe,
5959
std=std, limited=limited)
6060

Lib/test/test_peg_generator/test_c_parser.py

+1-1
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)