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

Avoid copying files from local directory #4940

Closed
borgeser opened this issue Feb 1, 2022 · 4 comments
Closed

Avoid copying files from local directory #4940

borgeser opened this issue Feb 1, 2022 · 4 comments
Labels
OS: MacOS This issue affects MacOS. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv.

Comments

@borgeser
Copy link

borgeser commented Feb 1, 2022

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.

@oz123
Copy link
Contributor

oz123 commented Feb 4, 2022

Please specify which pipenv version and operating system you use.

@oz123 oz123 added Status: Needs More Information This issue does not provide enough information to take further action. Waiting for feedback labels Feb 4, 2022
@borgeser
Copy link
Author

borgeser commented Feb 4, 2022

I'm using pipenv, version 2022.1.8 on macOS Big Sur 11.6

@oz123 oz123 added OS: MacOS This issue affects MacOS. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv. and removed Status: Needs More Information This issue does not provide enough information to take further action. Waiting for feedback labels Feb 4, 2022
@rly1
Copy link

rly1 commented Mar 14, 2022

I have the same problem, with pipenv, version 2022.1.8 on Windows 10 (with a bash interpreter).

MWE:

mkdir test-pipenv
cd test-pipenv
printf "from setuptools import setup\nsetup(name='test-pipenv')" > setup.py
pipenv install .

Output:

Creating a Pipfile for this project...
Installing ....
Adding test-pipenv to Pipfile's [packages]...
Installation Succeeded
Pipfile.lock not found, creating...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
           Building requirements...
c:\users\ryan\miniconda3\lib\site-packages\pipenv\patched\notpip\_internal\operations\prepare.py:218: 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.
  deprecated(
Resolving dependencies...
Success!
Warning: c:\users\ryan\miniconda3\lib\site-packages\pipenv\patched\notpip\_internal\operations\prepare.py:218: 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.
  deprecated(
c:\users\ryan\miniconda3\lib\site-packages\pipenv\patched\notpip\_internal\operations\prepare.py:218: 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.
  deprecated(
Updated Pipfile.lock (a2c60b)!
Installing dependencies from Pipfile.lock (a2c60b)...
c:\users\ryan\miniconda3\lib\site-packages\pipenv\patched\notpip\_internal\operations\prepare.py:218: 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.
  deprecated(
  ================================ 1/1 - 00:00:02
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.

I believe the solution proposed by OP, which is in progress at #4966, would resolve this PipDeprecationWarning and performance issue.

@matteius
Copy link
Member

pipenv==2022.4.20 has been released which includes the pip 22.0.4 vendoring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS: MacOS This issue affects MacOS. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv.
Projects
None yet
Development

No branches or pull requests

4 participants