-
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 ♥ |
FIX Fix the pip warning explained here: pypa/pip#11457 By following this procedure: pypa/pip#11457 (comment)
…le (see pypa/pip#11457) for Dockerfile.mamba
- Have tox install current LTS release of nodejs - Have tox install latest v2.x release of CDK CLI - Update pip editable install to work with pip 25+ The last point addresses the following warning when running tox: > DEPRECATION: Legacy editable install of hls_lambda_layer==0.0.0 from > file:///Users/chuck/src/NASA-IMPACT/hls-orchestration/layers/hls_lambda_layer/python > (setup.py develop) is deprecated. pip 25.0 will enforce this behaviour > change. A possible replacement is 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. > Discussion can be found at pypa/pip#11457
- Have tox install current LTS release of nodejs - Have tox install latest v2.x release of CDK CLI - Update pip editable install to work with pip 25+ The last point addresses the following warning when running tox: > DEPRECATION: Legacy editable install of hls_lambda_layer==0.0.0 from > file:///Users/chuck/src/NASA-IMPACT/hls-orchestration/layers/hls_lambda_layer/python > (setup.py develop) is deprecated. pip 25.0 will enforce this behaviour > change. A possible replacement is 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. > Discussion can be found at pypa/pip#11457
Original comment: #11457 (comment) I can't edit the issue description as always, but as a regular reminder to all, the However, at the bare minimum, please add a |
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?
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.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?
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 not support or function correctly under an editable install using the modern mechanism,
pip install -e
will break starting with pip 25.0.What should I do?
There are a couple of choices:
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.Tip
If the resulting 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.Tip
Which solution you choose to use depends on the project, but option one is recommended as there are other benefits to adding a
pyproject.toml
file. For example, you can declare your project metadata inpyproject.toml
. If your project already works fine using the modern mechanism, option two is an acceptable way to silence the deprecation warning in the meanwhile.The text was updated successfully, but these errors were encountered: