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
3 changes: 3 additions & 0 deletions news/6770.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'pip install .' is very slow in the presence of large directories in the source tree.
omry marked this conversation as resolved.
Show resolved Hide resolved
#6770 excludes .tox and .nox from being copied by 'pip install .', significantly speeding
up the builds when those directories are large.
11 changes: 10 additions & 1 deletion src/pip/_internal/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,16 @@ 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,
# Pulling in those directories can potentially
# be very slow.
# see dicsussion at:
omry marked this conversation as resolved.
Show resolved Hide resolved
# https://github.com/pypa/pip/issues/2195
# https://github.com/pypa/pip/pull/2196
ignore=shutil.ignore_patterns('.tox', '.nox'))
omry marked this conversation as resolved.
Show resolved Hide resolved

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