Skip to content

Commit 26f9aa4

Browse files
committed
Deprecate pip install --editable calling setup.py develop
Deprecates `pip install --editable` falling back to `setup.py develop` when using a setuptools version that does not support PEP 660 (setuptools v63 and older). See: https://peps.python.org/pep-0660/ https://setuptools.pypa.io/en/latest/history.html#v64-0-0 Closes pypa#11457.
1 parent af00870 commit 26f9aa4

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

news/11457.removal.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Deprecate ``pip install --editable`` falling back to ``setup.py develop``
2+
when using a setuptools version that does not support :pep:`660`
3+
(setuptools v63 and older).

src/pip/_internal/req/req_install.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,15 @@ def install(
824824
)
825825

826826
if self.editable and not self.is_wheel:
827+
deprecated(
828+
reason=f"Legacy editable install of {self} is deprecated.",
829+
replacement=(
830+
"to upgrade setuptools to a version that supports PEP 660 (>= 64), "
831+
"or to install the package in non-editable mode"
832+
),
833+
gone_in="25.0",
834+
issue=11457,
835+
)
827836
if self.config_settings:
828837
logger.warning(
829838
"--config-settings ignored for legacy editable install of %s. "

tests/functional/test_install.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,7 +1338,7 @@ def test_install_package_with_prefix(
13381338

13391339
def _test_install_editable_with_prefix(
13401340
script: PipTestEnvironment, files: Dict[str, str]
1341-
) -> None:
1341+
) -> TestPipResult:
13421342
# make a dummy project
13431343
pkga_path = script.scratch_path / "pkga"
13441344
pkga_path.mkdir()
@@ -1366,6 +1366,8 @@ def _test_install_editable_with_prefix(
13661366
install_path = script.scratch / site_packages / "pkga.egg-link"
13671367
result.did_create(install_path)
13681368

1369+
return result
1370+
13691371

13701372
@pytest.mark.network
13711373
def test_install_editable_with_target(script: PipTestEnvironment) -> None:
@@ -1415,9 +1417,10 @@ def test_install_editable_legacy_with_prefix_setup_cfg(
14151417
requires = ["setuptools<64", "wheel"]
14161418
build-backend = "setuptools.build_meta"
14171419
"""
1418-
_test_install_editable_with_prefix(
1420+
result = _test_install_editable_with_prefix(
14191421
script, {"setup.cfg": setup_cfg, "pyproject.toml": pyproject_toml}
14201422
)
1423+
assert "upgrade setuptools to a version that supports PEP 660" in result.stderr
14211424

14221425

14231426
def test_install_package_conflict_prefix_and_user(

0 commit comments

Comments
 (0)