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

Conversation

edmorley
Copy link
Contributor

@edmorley edmorley commented Jul 7, 2024

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

Towards #11457.

@edmorley
Copy link
Contributor Author

@sbidoul @uranusjr I don't suppose you would have a moment for a review? :-)

Copy link
Member

@sbidoul sbidoul left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks! A couple of questions.

"to upgrade setuptools to a version that supports PEP 660 (>= 64), "
"or to install the package in non-editable mode"
),
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.

reason=f"Legacy editable install of {self} is deprecated.",
replacement=(
"to upgrade setuptools to a version that supports PEP 660 (>= 64), "
"or to install the package in non-editable mode"
Copy link
Member

Choose a reason for hiding this comment

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

echoing my (genuine) question on the issue, should we recommend to use --config-setting editable_mode=compat ?

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure about the recommendation of a non-editable install as an alternative.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm happy to remove the suggestion of switching to a non-editable install if preferred. The reason I included it, is that in my experience many end user blindly copy/paste from Stack Overflow for anything packaging related, and it's quite possible some users don't actually need an editable install for that specific package after all.

echoing my (genuine) question on the issue, should we recommend to use --config-setting editable_mode=compat ?

If you have a specific wording you'd like me to use, I'm happy to use that. Though I'm not sure how far down the rabbit hole of "lets list all the possible compatibility issues with setuptools in this deprecation message" we should go? ie: This code path is only hit when the setuptools in the current environment is stale - which might not be because of any compat issues, but just because they haven't updated it yet.

Copy link
Member

@sbidoul sbidoul Jul 13, 2024

Choose a reason for hiding this comment

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

Further thinking about this, upgrading setuptools will not necessarily make the warning go away, because we may have reached this point for a project without pyproject.toml (with setuptools and wheel pre-installed).

The compatibility issues I worry about is that PEP 660 editables from setuptools sometimes use
a mechanism that is very different from what setup.py develop does, that may cause problems with some packages that would need to be updated to work in that mode. Setuptools's compat editable mode is closer
to what setup.py develop does so causes less surprises.

So I would suggest:

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, "
    "you may want to consider --config-settings editable_mode=compat. "
    "Please consult the setuptools documentation for more information"
)

but I'm also eager to read suggestions from others.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sbidoul Thank you - I've updated the wording to use your suggestion :-)

@sbidoul sbidoul added this to the 24.2 milestone Jul 13, 2024
@sbidoul
Copy link
Member

sbidoul commented Jul 13, 2024

I tentatively added this to 24.2. @pradyunsg feel free to postpone if you are not comfortable with it.

@pradyunsg
Copy link
Member

Hmm... if we can get this ready to land in ~12 hours, I'm happy to include this.

@edmorley edmorley force-pushed the deprecate-setup-py-develop branch 4 times, most recently from a2f3813 to 2c4cf0e Compare July 13, 2024 22:12
@edmorley edmorley requested a review from sbidoul July 13, 2024 22:24
@edmorley
Copy link
Contributor Author

This is ready for re-review :-)

@sbidoul
Copy link
Member

sbidoul commented Jul 14, 2024

Thanks. I have updated #11457 to provide some guidance. Let me know if it is readable.

Copy link
Member

@ichard26 ichard26 left a comment

Choose a reason for hiding this comment

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

Would it be helpful to mention PEP 660 or "pyproject-based editable installs" so users know what to search for in the setuptools documentation or in a web search?

I'm on the fence since I know we generally avoid relying mentioning arbitrary PEPs as they aren't obvious to non-technical users, but it would be helpful to point them to how to find more information.

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.
@edmorley
Copy link
Contributor Author

Rebased on main.

Would it be helpful to mention PEP 660 or "pyproject-based editable installs" so users know what to search for in the setuptools documentation or in a web search?

The original deprecation message did mention it, but the suggested new wording (which I switched to), does not:
#12830 (comment)

However, the changelog entry and the GitHub issue that the deprecation warning points at both link to PEP 660, so I think that's fine? :-)

@pradyunsg pradyunsg merged commit 6576879 into pypa:main Jul 15, 2024
28 checks passed
@pradyunsg
Copy link
Member

Thanks @edmorley!

@edmorley edmorley deleted the deprecate-setup-py-develop branch July 15, 2024 09:51
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants