What does this deprecation warning mean, and how to fix it?

Question:

When I install a local python package with pip 21.1 (pip install .)I get a deprecation warning:

 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 do not understand what what means.
Also, how can I fix it?

Asked By: Alex

||

Answers:

In short, my understanding:

  • pip builds a tree of dependencies between packages.
  • currently pip requires a temporary folder
  • this leads sometimes to issues, especially if relative paths are involved, see here.

To fix this and additional issues. they will change the behaviour of pip install. So to test if that will affect you in any way you can test it before by using --use-feature=in-tree-build as described by @Jason Harrison.

As mentioned in the warning there is a github discussion which explains it in much more detail here.

Answered By: Andreas

While the answer by @andreas links to the discussions and answers the question. The way to use the flag is to include it after the target:

pip install . --use-feature=in-tree-build

This is the "same" as using the –editable flag: the source of the package is used as the source of the installation without any copies being made. This is extra useful when your working copy of the repository has large extra debugging or binary files lying around that would need to be copied to a temporary location.

Answered By: Jason Harrison
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.