-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conversation
16d95d4
to
26f9aa4
Compare
26f9aa4
to
41be68f
Compare
There was a problem hiding this 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", |
There was a problem hiding this comment.
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.
src/pip/_internal/req/req_install.py
Outdated
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" |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 :-)
I tentatively added this to 24.2. @pradyunsg feel free to postpone if you are not comfortable with it. |
Hmm... if we can get this ready to land in ~12 hours, I'm happy to include this. |
a2f3813
to
2c4cf0e
Compare
This is ready for re-review :-) |
Thanks. I have updated #11457 to provide some guidance. Let me know if it is readable. |
There was a problem hiding this 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.
2c4cf0e
to
bae5d1d
Compare
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.
bae5d1d
to
2bb011a
Compare
Rebased on
The original deprecation message did mention it, but the suggested new wording (which I switched to), does not: 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? :-) |
Thanks @edmorley! |
Deprecates
pip install --editable
falling back tosetup.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.