diff --git a/setuptools/_vendor/_validate_pyproject/NOTICE b/setuptools/_vendor/_validate_pyproject/NOTICE index 020083ac22..003d646f1f 100644 --- a/setuptools/_vendor/_validate_pyproject/NOTICE +++ b/setuptools/_vendor/_validate_pyproject/NOTICE @@ -1,7 +1,7 @@ The code contained in this directory was automatically generated using the following command: - python -m validate_pyproject.vendoring --output-dir setuptools/_vendor/_validate_pyproject --enable-plugins setuptools distutils --very-verbose + python -m validate_pyproject.vendoring --output-dir=setuptools/_vendor/_validate_pyproject --enable-plugins setuptools distutils --very-verbose Please avoid changing it manually. diff --git a/setuptools/extern/__init__.py b/setuptools/extern/__init__.py index 0560faae18..395d58fd67 100644 --- a/setuptools/extern/__init__.py +++ b/setuptools/extern/__init__.py @@ -71,6 +71,6 @@ def install(self): names = ( 'packaging', 'pyparsing', 'ordered_set', 'more_itertools', 'importlib_metadata', - 'zipp', 'importlib_resources', 'jaraco', 'tomli', '_validate_pyproject' + 'zipp', 'importlib_resources', 'jaraco', 'tomli', '_validate_pyproject', ) VendorImporter(__name__, names, 'setuptools._vendor').install() diff --git a/tools/vendored.py b/tools/vendored.py index 70f9104dac..de3a6fe6e8 100644 --- a/tools/vendored.py +++ b/tools/vendored.py @@ -1,7 +1,5 @@ -import os import re import sys -import shutil import string import subprocess import venv @@ -145,16 +143,17 @@ def install_validate_pyproject(vendor): opts["ignore_cleanup_errors"] = True with TemporaryDirectory(**opts) as tmp: - venv.create(tmp, with_pip=True) - path = os.pathsep.join(Path(tmp).glob("*")) - venv_python = shutil.which("python", path=path) + env_builder = venv.EnvBuilder(with_pip=True) + env_builder.create(tmp) + context = env_builder.ensure_directories(tmp) + venv_python = getattr(context, 'env_exec_cmd', context.env_exe) + subprocess.check_call([venv_python, "-m", "pip", "install", pkg]) cmd = [ venv_python, "-m", "validate_pyproject.vendoring", - "--output-dir", - str(vendor / "_validate_pyproject"), + f"--output-dir={vendor / '_validate_pyproject' !s}", "--enable-plugins", "setuptools", "distutils",