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:
parent
00ec8e636c
commit
aeb43ce9f8
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue