-
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
#11457
Comments
This is complicated by the fact that https://numpy.org/doc/stable/reference/distutils_status_migration.html |
Adding a cross-reference to the idea of dropping support for this, starting Python 3.12+ (circa #8102 (comment)). This also makes sense since we'd stop install setuptools by default in ensurepip starting with that Python version, and get-pip.py as well, I imagine. |
Is it worth adding a deprecation message for the |
Is here the correct place for the deprecation warning? pip/src/pip/_internal/req/req_install.py Lines 829 to 842 in 2a0acb5
|
I think so, either this or inside |
@edmorley I personally think so yes. A question I have is if the deprecation message should mention that |
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.
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.
I've opened #12830 to add the deprecation warning for the |
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.
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.
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.
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.
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.
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.
Nice work yall ♥ |
Updates the requirements on [pip](https://github.com/pypa/pip) to permit the latest version. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/pypa/pip/blob/main/NEWS.rst">pip's changelog</a>.</em></p> <blockquote> <h1>24.3.1 (2024-10-27)</h1> <h2>Bug Fixes</h2> <ul> <li>Allow multiple nested inclusions of the same requirements file again. (<code>[#13046](pypa/pip#13046) <https://github.com/pypa/pip/issues/13046></code>_)</li> </ul> <h1>24.3 (2024-10-27)</h1> <h2>Deprecations and Removals</h2> <ul> <li>Deprecate wheel filenames that are not compliant with :pep:<code>440</code>. (<code>[#12918](pypa/pip#12918) <https://github.com/pypa/pip/issues/12918></code>_)</li> </ul> <h2>Features</h2> <ul> <li>Detect recursively referencing requirements files and help users identify the source. (<code>[#12653](pypa/pip#12653) <https://github.com/pypa/pip/issues/12653></code>_)</li> <li>Support for :pep:<code>730</code> iOS wheels. (<code>[#12961](pypa/pip#12961) <https://github.com/pypa/pip/issues/12961></code>_)</li> </ul> <h2>Bug Fixes</h2> <ul> <li>Display a better error message when an already installed package has an invalid requirement. (<code>[#12953](pypa/pip#12953) <https://github.com/pypa/pip/issues/12953></code>_)</li> <li>Ignore <code>PIP_TARGET</code> and <code>pip.conf</code> <code>global.target</code> when preparing a build environment. (<code>[#8438](pypa/pip#8438) <https://github.com/pypa/pip/issues/8438></code>_)</li> <li>Restore support for macOS 10.12 and older (via truststore). (<code>[#12901](pypa/pip#12901) <https://github.com/pypa/pip/issues/12901></code>_)</li> <li>Allow installing pip in editable mode in a virtual environment on Windows. (<code>[#12666](pypa/pip#12666) <https://github.com/pypa/pip/issues/12666></code>_)</li> </ul> <h2>Vendored Libraries</h2> <ul> <li>Upgrade certifi to 2024.8.30</li> <li>Upgrade distlib to 0.3.9</li> <li>Upgrade truststore to 0.10.0</li> <li>Upgrade urllib3 to 1.26.20</li> </ul> <h1>24.2 (2024-07-28)</h1> <h2>Deprecations and Removals</h2> <ul> <li>Deprecate <code>pip install --editable</code> falling back to <code>setup.py develop</code> when using a setuptools version that does not support :pep:<code>660</code> (setuptools v63 and older). (<code>[#11457](pypa/pip#11457) <https://github.com/pypa/pip/issues/11457></code>_)</li> </ul> <p>Features</p> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/pypa/pip/commit/05293b6b55eca86490b7c2944bcc558a56064f0d"><code>05293b6</code></a> Bump for release</li> <li><a href="https://github.com/pypa/pip/commit/6a5db8b107bb0063c69dc5ccd39dbfef14ca7a32"><code>6a5db8b</code></a> Merge pull request <a href="https://redirect.github.com/pypa/pip/issues/13047">#13047</a> from sbidoul/fix-13046</li> <li><a href="https://github.com/pypa/pip/commit/7be54ced1cca2c850e79e8fbe9ec2b76947b2b6f"><code>7be54ce</code></a> Don't fail when the same req file is included more than once</li> <li><a href="https://github.com/pypa/pip/commit/4f6aeb17ed540e181b9ad1dea8d7b5389effd21b"><code>4f6aeb1</code></a> Merge pull request <a href="https://redirect.github.com/pypa/pip/issues/13044">#13044</a> from sbidoul/release/24.3</li> <li><a href="https://github.com/pypa/pip/commit/e1b1d51fe8d0f4b84b77206173ceb656caa2edeb"><code>e1b1d51</code></a> Bump for development</li> <li><a href="https://github.com/pypa/pip/commit/cdba22f49b425fe4a57a8daf992fd6335c8010a1"><code>cdba22f</code></a> Bump for release</li> <li><a href="https://github.com/pypa/pip/commit/27f8374e8dd49141bd2397c0e8e8093cf3676ff7"><code>27f8374</code></a> Update AUTHORS.txt</li> <li><a href="https://github.com/pypa/pip/commit/c79d01953357913f421f192f51ffa9bab0a75ba0"><code>c79d019</code></a> Merge pull request <a href="https://redirect.github.com/pypa/pip/issues/13033">#13033</a> from sbidoul/vendoring-24.3-sbi</li> <li><a href="https://github.com/pypa/pip/commit/3ca89215a96f9b05619fc52bb778c19f26b84a9f"><code>3ca8921</code></a> Merge pull request <a href="https://redirect.github.com/pypa/pip/issues/13041">#13041</a> from sethmlarson/truststore-0.10.0</li> <li><a href="https://github.com/pypa/pip/commit/0cc7375ff0a42ddfa19f23f42cb96d6d7c06d29b"><code>0cc7375</code></a> Upgrade vendored truststore to 0.10.0</li> <li>Additional commits viewable in <a href="https://github.com/pypa/pip/compare/24.1.1...24.3.1">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details>
setup.py develop is deprecated. pip 25.0 will enforce this behaviour change. Discussion can be found at pypa/pip#11457
Another naive pip user here... I tried all the different flag combinations that are suggested here, but I can't use the development mode anymore. Is there a clear instruction somewhere how to get it to work? It is a pity this really handy feature has been deprecated... |
@tomasstolker Editable installs have not been deprecated. Did you read the initial post here? Does your project include a Without knowing what you did and what happened, it’s hard to offer any further information. |
Sorry I meant a change in how the development mode is used. I did read the initial post and tried out the suggestions on how to get it to work again. Also including this in my
I am using |
Not without knowing what you did, and what pip’s output was, no. Ideally run pip with verbose output switched on, as that gives extra information. |
This a cropped version of some of the
After this installation, when I make a change to the code, it is not recognized. It is only included in the installation if I do In the verbose output I do not see anything that may point at a problem but happy to share more details! |
OK so pip did the editable install. You need to check with setuptools. They use a different editable install approach in newer versions - maybe that’s the issue? |
Okay that could be, but it is beyond my understanding of these tools... I tried a few different versions of setuptools but still no success. |
Sorry it's frustrating - it's frustrating to us as well that setuptools changed how they implement editable installs at the same time as we switched to the new approach for calling setuptools. It makes it much harder to know what's a problem with pip and what's a problem with setuptools. In this case, it the pip output clearly shows that we correctly installed the package in editable mode, so your best bet is to open an issue in the setuptools project - hopefully they will be able to help you. |
Hi all, if you're still confused about what to do with this deprecation warning, I've updated the issue description to include more information for common questions:
|
Last updated on December 20, 2024.
There is now a standardized mechanism for an installer like pip to request an editable install of a project.
pip is transitioning to using this standard only instead of invoking the deprecated
setup.py develop
command.What's being deprecated?
TL;DR: the execution of
setup.py develop
when pip does an editable install. The-e
/--editable
pip install option is not deprecated.There is a standardized mechanism (called PEP 660) for an installers to request an editable install of a project. The benefit of this modern mechanism is that it allows projects packaged using other tools (formally called "build backends") such as Hatch and Poetry to support editable installs.
Since pip 21.3, pip has switched to using this mechanism where possible. Now the pip project seeks to deprecate and eventually remove the old and setuptools-specific fallback to running
setup.py develop
when apyproject.toml
is not present or the PEP 660 mechanism is unsupported for some reason.If your package is pure Python and follows the
src/
layout, the modern mechanism for editable installs will likely "just work" without any major issues. However, pip is issuing a deprecation warning any time the legacy mechanism is used in an effort to warn you that your project may be affected.Some historical context if you're interested
Historically, there was no standard way for installers like pip to request an editable install of a project. Thus, the
-e
/--editable
option was implemented as a wrapper over thesetup.py develop
command. Using this method, only setuptools projects could use editable installs. PEP 660 defines an interface which build backends can implement in order to support editable installs.If you are still interested and want more details, they are available on @ichard26's blog post on the changes in pip 24.2. You should read this issue first though!
How will this affect my project?
TL;DR: if your project does not support or function properly using the modern mechanism for editable installs,
pip install -e
is liable to stop working starting with pip 25.0 (Q1 2025).If you have received a deprecation warning about a legacy editable install, pip is using the legacy
setup.py develop
method for performing an editable installation of your project. In practice, this usually means one of two things:pyproject.toml
file doesn’t exist at all, thus pip will opt-out of the modern mechanism and usesetup.py develop
[build-system].requires
field) is too old and doesn’t support PEP 660, i.e. anything older than setuptools 64.0.0The current plan is that support for legacy editable installs will be entirely removed in pip 25.0 (Q1 2025). If your package doesn't support or function correctly under an editable install using the modern mechanism,
pip install -e
will break starting with pip 25.0.Note
If your package works fine with the modern editable mechanism (you can verify this by forcing the modern mechanism by passing
--use-pep517
), your package will continue to work without any changes, even if it currently uses the legacy mechanism for reasons listed above. pip 25 will always attempt to use the modern mechanism, even if the project doesn't have apyproject.toml
file (pip will assume the project needs setuptools to build).In other words, once the legacy mechanism is entirely removed,
--use-pep517
(solution 2 below) will always be ON for ALL editable installations.What should I do?
There are a couple of choices to address the deprecation warning, depending on your project's needs:
Add a
pyproject.toml
to your project, making sure the[build-system]
section requiressetuptools >= 64
, as well as other libraries required to build your project (the equivalent of setuptools'setup_requires
parameter). A basic example is included below:Alternatively, enable the
--use-pep517
pip option, possibly with--no-build-isolation
. The--use-pip517
flag will force pip to use the modern mechanism for editable installs.--no-build-isolation
may be needed if your project has build-time requirements beyondsetuptools
andwheel
. By passing this flag, you are responsible for making sure your environment already has the required dependencies to build your package. Once the legacy mechanism is removed,--use-pep517
will have no effect and will essentially be enabled by default in this context.Lastly, nothing. As noted above, if your project already works fine with the modern editable mechanism, it will continue to work in 2025 even when the legacy mechanism is removed. The deprecation warning will disappear, and pip will transparently transition to always using the modern mechanism. This is the preferred solution if making changes to the project is undesirable or impossible (e.g. legacy or read-only projects, static archives, etc.).
Tip
Setuptools has changed how editable installs work when the modern mechanism is used. If your modern installation does not behave correctly, you may want to try the
--config-setting editable_mode=compat
pip option. Please consult the setuptools documentation for more information.Important
Please note that the
setup.py
file itself is not deprecated. Even in 2025, you'll be able to use it to configure setuptools. What's changing that is that pip is not going to special case forsetup.py
while performing an editable install. Going forward, pip is going to exclusively use the standardized mechanism for editable installs (PEP 660) which pip and setuptools already support and use.You can keep your
setup.py
file if you wish. We strongly recommend—at the bare minimum—declaring your package's build backend inpyproject.toml
as described earlier (there are benefits, such as, you can declare your project metadata inpyproject.toml
), but it is not mandatory. If no build backend is declared, pip will assume you're using setuptools, and as long as the modern editable install mechanism works fine with your package,pip install -e
will continue to work. So, old or legacy projects should have a high likelihood of working :)The text was updated successfully, but these errors were encountered: