Skip to content

Commit a2f3813

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 c2d706f commit a2f3813

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

news/11457.removal.rst

+3
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

+12
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,18 @@ def install(
825825
)
826826

827827
if self.editable and not self.is_wheel:
828+
deprecated(
829+
reason=f"Legacy editable install of {self} (setup.py develop) is deprecated.",
830+
replacement=(
831+
"to add a pyproject.toml or enable --use-pep517, "
832+
"and use setuptools >= 64. "
833+
"If the resulting installation is not behaving as expected, "
834+
"try using --config-settings editable_mode=compat. "
835+
"Please consult the setuptools documentation for more information"
836+
),
837+
gone_in="25.0",
838+
issue=11457,
839+
)
828840
if self.config_settings:
829841
logger.warning(
830842
"--config-settings ignored for legacy editable install of %s. "

tests/functional/test_install.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,7 @@ def test_install_package_with_prefix(
13501350

13511351
def _test_install_editable_with_prefix(
13521352
script: PipTestEnvironment, files: Dict[str, str]
1353-
) -> None:
1353+
) -> TestPipResult:
13541354
# make a dummy project
13551355
pkga_path = script.scratch_path / "pkga"
13561356
pkga_path.mkdir()
@@ -1378,6 +1378,8 @@ def _test_install_editable_with_prefix(
13781378
install_path = script.scratch / site_packages / "pkga.egg-link"
13791379
result.did_create(install_path)
13801380

1381+
return result
1382+
13811383

13821384
@pytest.mark.network
13831385
def test_install_editable_with_target(script: PipTestEnvironment) -> None:
@@ -1427,9 +1429,10 @@ def test_install_editable_legacy_with_prefix_setup_cfg(
14271429
requires = ["setuptools<64", "wheel"]
14281430
build-backend = "setuptools.build_meta"
14291431
"""
1430-
_test_install_editable_with_prefix(
1432+
result = _test_install_editable_with_prefix(
14311433
script, {"setup.cfg": setup_cfg, "pyproject.toml": pyproject_toml}
14321434
)
1435+
assert "(setup.py develop) is deprecated" in result.stderr
14331436

14341437

14351438
def test_install_package_conflict_prefix_and_user(

0 commit comments

Comments
 (0)