https://github.com/python/cpython/commit/c9f3f5b4ed52d7bed6073ffa39717ece47202558
commit: c9f3f5b4ed52d7bed6073ffa39717ece47202558
branch: main
author: Adam Turner <9087854+aa-tur...@users.noreply.github.com>
committer: AA-Turner <9087854+aa-tur...@users.noreply.github.com>
date: 2025-04-25T00:46:20+01:00
summary:

gh-132415: Update vendored setuptools in ``Lib/test/wheeldata`` (#132887)

files:
A Lib/test/wheeldata/setuptools-79.0.1-py3-none-any.whl
D Lib/test/wheeldata/setuptools-67.6.1-py3-none-any.whl
D Lib/test/wheeldata/wheel-0.43.0-py3-none-any.whl
M Lib/test/support/__init__.py
M Lib/test/test_cext/__init__.py
M Lib/test/test_cppext/__init__.py
M Lib/test/test_peg_generator/test_c_parser.py

diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 3062ec6588fd16..71820a20d50e6c 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -2416,7 +2416,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 + '-'
@@ -2425,16 +2425,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)
@@ -2458,10 +2458,10 @@ def run_command(cmd):
         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
diff --git a/Lib/test/test_cext/__init__.py b/Lib/test/test_cext/__init__.py
index 402a2d04fa875e..46fde541494aa3 100644
--- a/Lib/test/test_cext/__init__.py
+++ b/Lib/test/test_cext/__init__.py
@@ -53,7 +53,7 @@ def test_build_limited_c11(self):
 
     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)
 
diff --git a/Lib/test/test_cppext/__init__.py b/Lib/test/test_cppext/__init__.py
index 13f9ea1c56cca5..2b7adac4bccd15 100644
--- a/Lib/test/test_cppext/__init__.py
+++ b/Lib/test/test_cppext/__init__.py
@@ -54,7 +54,7 @@ def test_build_limited(self):
 
     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)
 
diff --git a/Lib/test/test_peg_generator/test_c_parser.py 
b/Lib/test/test_peg_generator/test_c_parser.py
index 1411e55dd0f293..1095e7303c188f 100644
--- a/Lib/test/test_peg_generator/test_c_parser.py
+++ b/Lib/test/test_peg_generator/test_c_parser.py
@@ -99,7 +99,7 @@ def setUpClass(cls):
         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
index 4b7ffd2e49e155..00000000000000
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
index 00000000000000..3eb896915897fb
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
index 67e2308717d675..00000000000000
Binary files a/Lib/test/wheeldata/wheel-0.43.0-py3-none-any.whl and /dev/null 
differ

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to