Skip to content

Commit

Permalink
BUG: finish fix for speeding up "pip install .".
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
rgommers committed Nov 3, 2015
1 parent 4bc2480 commit f7b8983
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions pip/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,9 +694,7 @@ def unpack_file_url(link, location, download_dir=None):

# If it's a url to a local directory
if os.path.isdir(link_path):
if os.path.isdir(location):
rmtree(location)
shutil.copytree(link_path, location, symlinks=True)
_copy_dist_from_dir(link_path, location)
if download_dir:
logger.info('Link is a directory, ignoring download_dir')
return
Expand Down Expand Up @@ -736,12 +734,6 @@ def _copy_dist_from_dir(link_path, location):
pip install ~/dev/git-repos/python-prompt-toolkit
"""

# Note: This is currently VERY SLOW if you have a lot of data in the
# directory, because it copies everything with `shutil.copytree`.
# What it should really do is build an sdist and install that.
# See https://github.com/pypa/pip/issues/2195

if os.path.isdir(location):
rmtree(location)

Expand Down

0 comments on commit f7b8983

Please sign in to comment.