1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Speed up unpack_file_url

by ignoring .tox, .git, .hg, .bzr, and .svn  when doing
`shutil.copytree` in unpack_file_url in pip/download.py.

Fixes: GH-2195
This commit is contained in:
Marc Abramowitz 2014-12-15 15:28:58 -08:00
parent 00ec8e636c
commit aeb43ce9f8

View file

@ -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