From 1418b5fc046d74d3865688e117c6d0f1bac6f406 Mon Sep 17 00:00:00 2001 From: Ben Mares <15216687+maresb@users.noreply.github.com> Date: Wed, 7 Jul 2021 10:34:06 +0200 Subject: [PATCH 1/4] Improve the phrasing of in-tree-build deprecation Context is explained in the following comment: --- news/10128.removal.rst | 1 + src/pip/_internal/operations/prepare.py | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 news/10128.removal.rst diff --git a/news/10128.removal.rst b/news/10128.removal.rst new file mode 100644 index 00000000000..850b645642f --- /dev/null +++ b/news/10128.removal.rst @@ -0,0 +1 @@ +Improve deprecation warning regarding the copying of source trees when installing from a local directory. diff --git a/src/pip/_internal/operations/prepare.py b/src/pip/_internal/operations/prepare.py index 247e63fc86c..eddbac26d51 100644 --- a/src/pip/_internal/operations/prepare.py +++ b/src/pip/_internal/operations/prepare.py @@ -216,11 +216,12 @@ def unpack_url( # be removed. if link.is_existing_dir(): deprecated( - "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.\n", + "pip currently copies the source tree into a temporary directory " + "before building it. In the future, pip will build packages in-place " + "within the original source tree (\"in-tree build\"). Before the " + "default behavior changes, we recommend testing your packages by " + "adding the --use-feature=in-tree-build argument. Regarding the " + "current out-of-tree default build behavior,\n", replacement=None, gone_in="21.3", issue=7555 From a2252a3b332fa3cf9d8692ef7486e6c78af984e9 Mon Sep 17 00:00:00 2001 From: Ben Mares <15216687+maresb@users.noreply.github.com> Date: Tue, 27 Jul 2021 15:32:31 -0700 Subject: [PATCH 2/4] Switch deprecation message to use feature_flag --- src/pip/_internal/operations/prepare.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/pip/_internal/operations/prepare.py b/src/pip/_internal/operations/prepare.py index eddbac26d51..abf27564471 100644 --- a/src/pip/_internal/operations/prepare.py +++ b/src/pip/_internal/operations/prepare.py @@ -216,15 +216,13 @@ def unpack_url( # be removed. if link.is_existing_dir(): deprecated( - "pip currently copies the source tree into a temporary directory " - "before building it. In the future, pip will build packages in-place " - "within the original source tree (\"in-tree build\"). Before the " - "default behavior changes, we recommend testing your packages by " - "adding the --use-feature=in-tree-build argument. Regarding the " - "current out-of-tree default build behavior,\n", + reason="pip copied the source tree into a temporary directory " + "before building it. This is changing so that packages are built in-place " + 'within the original source tree ("in-tree build").', replacement=None, gone_in="21.3", - issue=7555 + feature_flag="in-tree-build", + issue=7555, ) if os.path.isdir(location): rmtree(location) From 89f6c918066174b62f4e20ef1c6ba79070c673a3 Mon Sep 17 00:00:00 2001 From: Ben Mares <15216687+maresb@users.noreply.github.com> Date: Thu, 29 Jul 2021 15:50:25 -0700 Subject: [PATCH 3/4] Improve style for multiline string Co-authored-by: Pradyun Gedam --- src/pip/_internal/operations/prepare.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pip/_internal/operations/prepare.py b/src/pip/_internal/operations/prepare.py index abf27564471..a57c1116d96 100644 --- a/src/pip/_internal/operations/prepare.py +++ b/src/pip/_internal/operations/prepare.py @@ -216,9 +216,11 @@ def unpack_url( # be removed. if link.is_existing_dir(): deprecated( - reason="pip copied the source tree into a temporary directory " - "before building it. This is changing so that packages are built in-place " - 'within the original source tree ("in-tree build").', + reason=( + "pip copied the source tree into a temporary directory " + "before building it. This is changing so that packages are built in-place " + 'within the original source tree ("in-tree build").' + ), replacement=None, gone_in="21.3", feature_flag="in-tree-build", From e8b5b585d316241a086d1a737804dd2728f15242 Mon Sep 17 00:00:00 2001 From: Ben Mares <15216687+maresb@users.noreply.github.com> Date: Thu, 29 Jul 2021 16:00:17 -0700 Subject: [PATCH 4/4] Fix long line --- src/pip/_internal/operations/prepare.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pip/_internal/operations/prepare.py b/src/pip/_internal/operations/prepare.py index a57c1116d96..8bb5a6843f5 100644 --- a/src/pip/_internal/operations/prepare.py +++ b/src/pip/_internal/operations/prepare.py @@ -218,7 +218,8 @@ def unpack_url( deprecated( reason=( "pip copied the source tree into a temporary directory " - "before building it. This is changing so that packages are built in-place " + "before building it. This is changing so that packages " + "are built in-place " 'within the original source tree ("in-tree build").' ), replacement=None,