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

Deprecate pip install --editable calling setup.py develop #12830

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions news/11457.removal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Deprecate ``pip install --editable`` falling back to ``setup.py develop``
when using a setuptools version that does not support :pep:`660`
(setuptools v63 and older).
15 changes: 15 additions & 0 deletions src/pip/_internal/req/req_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,21 @@ def install(
)

if self.editable and not self.is_wheel:
deprecated(
reason=(
f"Legacy editable install of {self} (setup.py develop) "
"is deprecated."
),
replacement=(
"to add a pyproject.toml or enable --use-pep517, "
"and use setuptools >= 64. "
"If the resulting installation is not behaving as expected, "
"try using --config-settings editable_mode=compat. "
"Please consult the setuptools documentation for more information"
),
gone_in="25.0",
Copy link
Member

@sbidoul sbidoul Jul 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That may be a bit soon, but we can postpone if we see too many problems being reported.

issue=11457,
)
if self.config_settings:
logger.warning(
"--config-settings ignored for legacy editable install of %s. "
Expand Down
7 changes: 5 additions & 2 deletions tests/functional/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,7 @@ def test_install_package_with_prefix(

def _test_install_editable_with_prefix(
script: PipTestEnvironment, files: Dict[str, str]
) -> None:
) -> TestPipResult:
# make a dummy project
pkga_path = script.scratch_path / "pkga"
pkga_path.mkdir()
Expand Down Expand Up @@ -1378,6 +1378,8 @@ def _test_install_editable_with_prefix(
install_path = script.scratch / site_packages / "pkga.egg-link"
result.did_create(install_path)

return result


@pytest.mark.network
def test_install_editable_with_target(script: PipTestEnvironment) -> None:
Expand Down Expand Up @@ -1427,9 +1429,10 @@ def test_install_editable_legacy_with_prefix_setup_cfg(
requires = ["setuptools<64", "wheel"]
build-backend = "setuptools.build_meta"
"""
_test_install_editable_with_prefix(
result = _test_install_editable_with_prefix(
script, {"setup.cfg": setup_cfg, "pyproject.toml": pyproject_toml}
)
assert "(setup.py develop) is deprecated" in result.stderr


def test_install_package_conflict_prefix_and_user(
Expand Down
Loading