Skip to content

Commit f7b8983

Browse files
committed
BUG: finish fix for speeding up "pip install .".
This is a follow-up to pypagh-2535, which added the code to copy via (sdist + unpack) instead of shutil.copytree, but forgot to actually call that function. Fixes pypagh-2195 (slow pip install of a dir).
1 parent 4bc2480 commit f7b8983

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

Diff for: pip/download.py

+1-9
Original file line numberDiff line numberDiff line change
@@ -694,9 +694,7 @@ def unpack_file_url(link, location, download_dir=None):
694694

695695
# If it's a url to a local directory
696696
if os.path.isdir(link_path):
697-
if os.path.isdir(location):
698-
rmtree(location)
699-
shutil.copytree(link_path, location, symlinks=True)
697+
_copy_dist_from_dir(link_path, location)
700698
if download_dir:
701699
logger.info('Link is a directory, ignoring download_dir')
702700
return
@@ -736,12 +734,6 @@ def _copy_dist_from_dir(link_path, location):
736734
pip install ~/dev/git-repos/python-prompt-toolkit
737735
738736
"""
739-
740-
# Note: This is currently VERY SLOW if you have a lot of data in the
741-
# directory, because it copies everything with `shutil.copytree`.
742-
# What it should really do is build an sdist and install that.
743-
# See https://github.com/pypa/pip/issues/2195
744-
745737
if os.path.isdir(location):
746738
rmtree(location)
747739

0 commit comments

Comments
 (0)