Skip to content

Commit d3755e0

Browse files
AA-Turnerhroncok
authored andcommitted
00666: pythongh-132415: Update vendored setuptools in Lib/test/wheeldata
(cherry picked from commit c9f3f5b) (actual changes in .whl files removed to make this patch smaller)
1 parent b5fa748 commit d3755e0

File tree

4 files changed

+10
-10
lines changed

4 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
@@ -2415,7 +2415,7 @@ def _findwheel(pkgname):
24152415
filenames = os.listdir(wheel_dir)
24162416
filenames = sorted(filenames, reverse=True) # approximate "newest" first
24172417
for filename in filenames:
2418-
# filename is like 'setuptools-67.6.1-py3-none-any.whl'
2418+
# filename is like 'setuptools-{version}-py3-none-any.whl'
24192419
if not filename.endswith(".whl"):
24202420
continue
24212421
prefix = pkgname + '-'
@@ -2424,16 +2424,16 @@ def _findwheel(pkgname):
24242424
raise FileNotFoundError(f"No wheel for {pkgname} found in {wheel_dir}")
24252425

24262426

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

24352434
def run_command(cmd):
24362435
if verbose:
2436+
import shlex
24372437
print()
24382438
print('Run:', ' '.join(map(shlex.quote, cmd)))
24392439
subprocess.run(cmd, check=True)
@@ -2457,10 +2457,10 @@ def run_command(cmd):
24572457
else:
24582458
python = os.path.join(venv, 'bin', python_exe)
24592459

2460-
cmd = [python, '-X', 'dev',
2460+
cmd = (python, '-X', 'dev',
24612461
'-m', 'pip', 'install',
24622462
_findwheel('setuptools'),
2463-
_findwheel('wheel')]
2463+
)
24642464
run_command(cmd)
24652465

24662466
yield python

Lib/test/test_cext/__init__.py

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

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,

0 commit comments

Comments
 (0)