diff --git a/pip/download.py b/pip/download.py index bbef9ea..4f10b90 100644 --- a/pip/download.py +++ b/pip/download.py @@ -671,9 +671,7 @@ def unpack_file_url(link, location, download_dir=None, hashes=None): # If it's a url to a local directory if is_dir_url(link): - if os.path.isdir(location): - rmtree(location) - shutil.copytree(link_path, location, symlinks=True) + _copy_dist_from_dir(link_path, location) if download_dir: logger.info('Link is a directory, ignoring download_dir') return @@ -719,11 +717,6 @@ def _copy_dist_from_dir(link_path, location): """ - # Note: This is currently VERY SLOW if you have a lot of data in the - # directory, because it copies everything with `shutil.copytree`. - # What it should really do is build an sdist and install that. - # See https://github.com/pypa/pip/issues/2195 - if os.path.isdir(location): rmtree(location)