@@ -375,7 +375,7 @@ def not_code_files_and_folders(path: str, names: List[str]) -> Iterable[str]:
375
375
@pytest .fixture (scope = "session" )
376
376
def pip_editable_parts (
377
377
pip_src : Path , tmpdir_factory : pytest .TempPathFactory
378
- ) -> Tuple [Path , Path , str ]:
378
+ ) -> Tuple [Path , ... ]:
379
379
pip_editable = tmpdir_factory .mktemp ("pip" ) / "pip"
380
380
shutil .copytree (pip_src , pip_editable , symlinks = True )
381
381
# noxfile.py is Python 3 only
@@ -399,8 +399,7 @@ def pip_editable_parts(
399
399
)
400
400
pth = next (pip_self_install_path .glob ("*pip*.pth" ))
401
401
dist_info = next (pip_self_install_path .glob ("*.dist-info" ))
402
- dist_info_name = os .path .basename (dist_info )
403
- return (pth , dist_info , dist_info_name )
402
+ return (pth , dist_info )
404
403
405
404
406
405
def _common_wheel_editable_install (
@@ -466,7 +465,7 @@ def virtualenv_template(
466
465
request : pytest .FixtureRequest ,
467
466
tmpdir_factory : pytest .TempPathFactory ,
468
467
pip_src : Path ,
469
- pip_editable_parts : Tuple [Path , Path , str ],
468
+ pip_editable_parts : Tuple [Path , ... ],
470
469
setuptools_install : Path ,
471
470
wheel_install : Path ,
472
471
coverage_install : Path ,
@@ -485,14 +484,15 @@ def virtualenv_template(
485
484
install_pth_link (venv , "setuptools" , setuptools_install )
486
485
install_pth_link (venv , "wheel" , wheel_install )
487
486
488
- pth , dist_info , dist_info_name = pip_editable_parts
489
-
490
- # Preserve ``.dist-info`` directory inside ``site-packages``
491
- dist_info_path = os .path .join (venv .site , dist_info_name )
492
- os .mkdir (dist_info_path )
487
+ pth , dist_info = pip_editable_parts
493
488
494
489
shutil .copy (pth , venv .site )
495
- shutil .copytree (dist_info , dist_info_path , dirs_exist_ok = True , symlinks = True )
490
+ shutil .copytree (
491
+ dist_info , venv .site / dist_info .name , dirs_exist_ok = True , symlinks = True
492
+ )
493
+ # Create placeholder ``easy-install.pth``, as several tests depend on its
494
+ # existance. TODO: Ensure ``tests.lib.TestPipResult.files_updated`` correctly
495
+ # detects changed files.
496
496
venv .site .joinpath ("easy-install.pth" ).touch ()
497
497
498
498
# Install coverage and pth file for executing it in any spawned processes
0 commit comments