@@ -2386,7 +2386,7 @@ def _findwheel(pkgname):
23862386 filenames = os .listdir (wheel_dir )
23872387 filenames = sorted (filenames , reverse = True ) # approximate "newest" first
23882388 for filename in filenames :
2389- # filename is like 'setuptools-67.6.1 -py3-none-any.whl'
2389+ # filename is like 'setuptools-{version} -py3-none-any.whl'
23902390 if not filename .endswith (".whl" ):
23912391 continue
23922392 prefix = pkgname + '-'
@@ -2395,16 +2395,16 @@ def _findwheel(pkgname):
23952395 raise FileNotFoundError (f"No wheel for { pkgname } found in { wheel_dir } " )
23962396
23972397
2398- # Context manager that creates a virtual environment, install setuptools and wheel in it
2399- # and returns the path to the venv directory and the path to the python executable
2398+ # Context manager that creates a virtual environment, install setuptools in it,
2399+ # and returns the paths to the venv directory and the python executable
24002400@contextlib .contextmanager
2401- def setup_venv_with_pip_setuptools_wheel (venv_dir ):
2402- import shlex
2401+ def setup_venv_with_pip_setuptools (venv_dir ):
24032402 import subprocess
24042403 from .os_helper import temp_cwd
24052404
24062405 def run_command (cmd ):
24072406 if verbose :
2407+ import shlex
24082408 print ()
24092409 print ('Run:' , ' ' .join (map (shlex .quote , cmd )))
24102410 subprocess .run (cmd , check = True )
@@ -2428,10 +2428,10 @@ def run_command(cmd):
24282428 else :
24292429 python = os .path .join (venv , 'bin' , python_exe )
24302430
2431- cmd = [ python , '-X' , 'dev' ,
2431+ cmd = ( python , '-X' , 'dev' ,
24322432 '-m' , 'pip' , 'install' ,
24332433 _findwheel ('setuptools' ),
2434- _findwheel ( 'wheel' )]
2434+ )
24352435 run_command (cmd )
24362436
24372437 yield python
0 commit comments