]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-132415: Update vendored setuptools in ``Lib/test/wheeldata`` (GH-132887...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 11 Jun 2025 14:55:14 +0000 (16:55 +0200)
committerGitHub <noreply@github.com>
Wed, 11 Jun 2025 14:55:14 +0000 (14:55 +0000)
(cherry picked from commit c9f3f5b4ed52d7bed6073ffa39717ece47202558)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Lib/test/support/__init__.py
Lib/test/test_cext/__init__.py
Lib/test/test_cppext/__init__.py
Lib/test/test_peg_generator/test_c_parser.py
Lib/test/wheeldata/setuptools-67.6.1-py3-none-any.whl [deleted file]
Lib/test/wheeldata/setuptools-79.0.1-py3-none-any.whl [new file with mode: 0644]
Lib/test/wheeldata/wheel-0.43.0-py3-none-any.whl [deleted file]

index 3d1e17d8aa2497c3343087a004d7c45c9bd03aa0..c2b407159a57ec6ae8a563a4063ed71cbc2a1dd9 100644 (file)
@@ -2386,7 +2386,7 @@ def _findwheel(pkgname):
     filenames = os.listdir(wheel_dir)
     filenames = sorted(filenames, reverse=True)  # approximate "newest" first
     for filename in filenames:
-        # filename is like 'setuptools-67.6.1-py3-none-any.whl'
+        # filename is like 'setuptools-{version}-py3-none-any.whl'
         if not filename.endswith(".whl"):
             continue
         prefix = pkgname + '-'
@@ -2395,16 +2395,16 @@ def _findwheel(pkgname):
     raise FileNotFoundError(f"No wheel for {pkgname} found in {wheel_dir}")
 
 
-# Context manager that creates a virtual environment, install setuptools and wheel in it
-# and returns the path to the venv directory and the path to the python executable
+# Context manager that creates a virtual environment, install setuptools in it,
+# and returns the paths to the venv directory and the python executable
 @contextlib.contextmanager
-def setup_venv_with_pip_setuptools_wheel(venv_dir):
-    import shlex
+def setup_venv_with_pip_setuptools(venv_dir):
     import subprocess
     from .os_helper import temp_cwd
 
     def run_command(cmd):
         if verbose:
+            import shlex
             print()
             print('Run:', ' '.join(map(shlex.quote, cmd)))
             subprocess.run(cmd, check=True)
@@ -2428,10 +2428,10 @@ def setup_venv_with_pip_setuptools_wheel(venv_dir):
         else:
             python = os.path.join(venv, 'bin', python_exe)
 
-        cmd = [python, '-X', 'dev',
+        cmd = (python, '-X', 'dev',
                '-m', 'pip', 'install',
                _findwheel('setuptools'),
-               _findwheel('wheel')]
+               )
         run_command(cmd)
 
         yield python
index 54859f9ff7622d13986d3cd86ede568a2b55b3fe..57f31c900d2e8d74ba69dd5b6d9479734f849759 100644 (file)
@@ -50,7 +50,7 @@ class TestExt(unittest.TestCase):
 
     def check_build(self, extension_name, std=None, limited=False):
         venv_dir = 'env'
-        with support.setup_venv_with_pip_setuptools_wheel(venv_dir) as python_exe:
+        with support.setup_venv_with_pip_setuptools(venv_dir) as python_exe:
             self._check_build(extension_name, python_exe,
                               std=std, limited=limited)
 
index d5195227308fecd90f384205971bb4b3339d7149..e7130f6fc68473e56677c4cdc0926c1945c300ed 100644 (file)
@@ -47,7 +47,7 @@ class TestCPPExt(unittest.TestCase):
 
     def check_build(self, extension_name, std=None, limited=False):
         venv_dir = 'env'
-        with support.setup_venv_with_pip_setuptools_wheel(venv_dir) as python_exe:
+        with support.setup_venv_with_pip_setuptools(venv_dir) as python_exe:
             self._check_build(extension_name, python_exe,
                               std=std, limited=limited)
 
index 1411e55dd0f293ac665339d410346291d57bf792..1095e7303c188f61ef3ee29532ab1a027131044d 100644 (file)
@@ -99,7 +99,7 @@ class TestCParser(unittest.TestCase):
         cls.addClassCleanup(shutil.rmtree, cls.library_dir)
 
         with contextlib.ExitStack() as stack:
-            python_exe = stack.enter_context(support.setup_venv_with_pip_setuptools_wheel("venv"))
+            python_exe = stack.enter_context(support.setup_venv_with_pip_setuptools("venv"))
             sitepackages = subprocess.check_output(
                 [python_exe, "-c", "import sysconfig; print(sysconfig.get_path('platlib'))"],
                 text=True,
diff --git a/Lib/test/wheeldata/setuptools-67.6.1-py3-none-any.whl b/Lib/test/wheeldata/setuptools-67.6.1-py3-none-any.whl
deleted file mode 100644 (file)
index 4b7ffd2..0000000
Binary files a/Lib/test/wheeldata/setuptools-67.6.1-py3-none-any.whl and /dev/null differ
diff --git a/Lib/test/wheeldata/setuptools-79.0.1-py3-none-any.whl b/Lib/test/wheeldata/setuptools-79.0.1-py3-none-any.whl
new file mode 100644 (file)
index 0000000..3eb8969
Binary files /dev/null and b/Lib/test/wheeldata/setuptools-79.0.1-py3-none-any.whl differ
diff --git a/Lib/test/wheeldata/wheel-0.43.0-py3-none-any.whl b/Lib/test/wheeldata/wheel-0.43.0-py3-none-any.whl
deleted file mode 100644 (file)
index 67e2308..0000000
Binary files a/Lib/test/wheeldata/wheel-0.43.0-py3-none-any.whl and /dev/null differ