Skip to content

Commit

Permalink
Speed up unpack_file_url
Browse files Browse the repository at this point in the history
by ignoring .tox, .git, .hg, .bzr, and .svn  when doing
`shutil.copytree` in unpack_file_url in pip/download.py.

Fixes: pypaGH-2195
  • Loading branch information
msabramo committed Dec 16, 2014
1 parent 00ec8e6 commit aeb43ce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pip/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,10 @@ def unpack_file_url(link, location, download_dir=None):
if os.path.isdir(link_path):
if os.path.isdir(location):
rmtree(location)
shutil.copytree(link_path, location, symlinks=True)
shutil.copytree(
link_path, location, symlinks=True,
ignore=shutil.ignore_patterns(
'.tox', '.git', '.hg', '.bzr', '.svn'))
if download_dir:
logger.info('Link is a directory, ignoring download_dir')
return
Expand Down

0 comments on commit aeb43ce

Please sign in to comment.