Skip to content

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

Open
@sbidoul

Description

@sbidoul

Last updated on January 12, 2025.

TL;DR: The -e / --editable pip install option is NOT deprecated. What is changing is the underlying method to achive it. The execution of setup.py develop when pip does an editable install is being repaced by a standardised interface.

UPDATE: The removal has been postponed to pip 25.2 (2025 Q3) as we haven't had the time to ensure all of our ducks are in a row for a smooth transition.

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 a pyproject.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 the setup.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.1 (Q2 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:

  • The pyproject.toml file doesn’t exist at all, thus pip will opt-out of the modern mechanism and use setup.py develop
  • The declared setuptools version (in the [build-system].requires field) is too old and doesn’t support PEP 660, i.e. anything older than setuptools 64.0.0

The current plan is that support for legacy editable installs will be entirely removed in pip 25.1 (Q2 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.1.

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.1 will always attempt to use the modern mechanism, even if the project doesn't have a pyproject.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 requires setuptools >= 64, as well as other libraries required to build your project (the equivalent of setuptools' setup_requires parameter). A basic example is included below:

    [build-system]
    # XXX: If your project needs other packages to build properly, add them to this list.
    requires = ["setuptools >= 64"]
    build-backend = "setuptools.build_meta"
  • 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 beyond setuptools and wheel. 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 for setup.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 in pyproject.toml as described earlier (there are benefits, such as, you can declare your project metadata in pyproject.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 :)

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions