Skip to content

Avoid copying files from local directory #4940

@borgeser

Description

@borgeser

Is your feature request related to a problem? Please describe.

I have a dependency in my Pipfile which target a local path:

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
mylib = {path = "."}
...

When I try to install dependencies pipenv install, it's really slow (> 10min for a single dependency).
Moreover a warning is shown on the console:

PipDeprecationWarning: DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
 pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.

I've investigated a bit and the root of the problem seems to be an issue with pip.
When building projects from local directories, pip first copies them to a temporary location.
The problem is that my folder is really big (> 400 Mo). It contains various non python files. It contains also a .venv folder which alone weighs 200Mo. So the copy phase is the bottleneck.

The issue has been fixed on pip by removing the copying phase. This is the issue mentioned in the previous warning. At first it was a new option (--use-feature=in-tree-build) and in pip 22.0.2, this is the default behaviour.

However the issue is still present in pipenv. It looks like pipenv is using its own copy of pip and it's not up to date.

Describe the solution you'd like

Updating https://github.com/pypa/pipenv/tree/main/pipenv/patched with the latest version of pip will solve my problem.

Describe alternatives you've considered

If it's not an option, I would like to pass arguments to the pip invoked by pipenv. If I can send the argument --use-feature=in-tree-build to pip, it should work as expected.

If it's also not an option, I would appreciate any workaround to help me to decrease the build time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS: MacOSThis issue affects MacOS.Type: Vendored DependenciesThis issue affects vendored dependencies within pipenv.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions