Skip to content

Commit 467772f

Browse files
AA-Turnervstinner
authored andcommitted
00460: 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) pythongh-127906: Add missing sys import to test_cppext (cherry picked from commit 9cba148) Co-Authored-By: Victor Stinner <[email protected]>
1 parent 8b137c5 commit 467772f

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎Lib/test/support/__init__.py‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2260,7 +2260,7 @@ def _findwheel(pkgname):
22602260
filenames = os.listdir(wheel_dir)
22612261
filenames = sorted(filenames, reverse=True) # approximate "newest" first
22622262
for filename in filenames:
2263-
# filename is like 'setuptools-67.6.1-py3-none-any.whl'
2263+
# filename is like 'setuptools-{version}-py3-none-any.whl'
22642264
if not filename.endswith(".whl"):
22652265
continue
22662266
prefix = pkgname + '-'
@@ -2269,10 +2269,10 @@ def _findwheel(pkgname):
22692269
raise FileNotFoundError(f"No wheel for {pkgname} found in {wheel_dir}")
22702270

22712271

2272-
# Context manager that creates a virtual environment, install setuptools and wheel in it
2273-
# and returns the path to the venv directory and the path to the python executable
2272+
# Context manager that creates a virtual environment, install setuptools in it,
2273+
# and returns the paths to the venv directory and the python executable
22742274
@contextlib.contextmanager
2275-
def setup_venv_with_pip_setuptools_wheel(venv_dir):
2275+
def setup_venv_with_pip_setuptools(venv_dir):
22762276
import subprocess
22772277
from .os_helper import temp_cwd
22782278

@@ -2295,8 +2295,7 @@ def setup_venv_with_pip_setuptools_wheel(venv_dir):
22952295

22962296
cmd = [python, '-X', 'dev',
22972297
'-m', 'pip', 'install',
2298-
_findwheel('setuptools'),
2299-
_findwheel('wheel')]
2298+
_findwheel('setuptools')]
23002299
if verbose:
23012300
print()
23022301
print('Run:', ' '.join(cmd))

‎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 check_build(self, extension_name, std=None, limited=False):
5353
self.skipTest('Py_LIMITED_API is incompatible with Py_TRACE_REFS')
5454

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
@@ -51,7 +51,7 @@ def check_build(self, extension_name, std=None, limited=False):
5151
self.skipTest('Py_LIMITED_API is incompatible with Py_TRACE_REFS')
5252

5353
venv_dir = 'env'
54-
with support.setup_venv_with_pip_setuptools_wheel(venv_dir) as python_exe:
54+
with support.setup_venv_with_pip_setuptools(venv_dir) as python_exe:
5555
self._check_build(extension_name, python_exe,
5656
std=std, limited=limited)
5757

‎Lib/test/test_cppext/setup.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import os
44
import platform
55
import shlex
6+
import sys
67
import sysconfig
78
from test import support
89

‎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)