Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exclude '.tox', '.nox' from being copied during 'pip install .' #6770

Merged
merged 14 commits into from
Aug 5, 2019
Next Next commit
exclude '.tox', '.nox', '.git', '.hg', '.bzr', '.svn' from pip instal…
…l . to speed installation up
  • Loading branch information
omry committed Jul 23, 2019
commit 3626530b4ac5f255ba8e0fb151a096c62f0335f3
14 changes: 13 additions & 1 deletion src/pip/_internal/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,19 @@ def unpack_file_url(
if is_dir_url(link):
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(
# Pulling in those directories can potentially be very slow.
# Excludin them speeds things up substantially in some cases.
# see dicsussion at:
# https://github.com/pypa/pip/issues/2195
# https://github.com/pypa/pip/pull/2196
'.tox', '.nox', '.git', '.hg', '.bzr', '.svn'
)
)

if download_dir:
logger.info('Link is a directory, ignoring download_dir')
return
Expand Down