DEPRECATION: Legacy editable install of coreg[dev]==0.14.0 from file:///... (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
I just started getting the above error when I pip install -e .
of one of my own packages. I maintain a number of libs that I want people to be able to do editable installs of. I'd rather not require users add extra flags when doing editable installs of them. pyproject.toml doesn't support the features I need, so I have to use setup.py. Is there a way I can set this up?
To address this issue while maintaining compatibility and ease of use for your users, you can make a few changes to your package setup. Here's a step-by-step approach:
-
Keep using
setup.py
for now, but add a minimalpyproject.toml
file to your project root. -
In the
pyproject.toml
, specifysetuptools
as the build system:[build-system] requires = ["setuptools>=64.0"] build-backend = "setuptools.build_meta"
-
In your
setup.py
, ensure you're usingsetuptools.setup()
and not the deprecateddistutils.core.setup()
. -
If you haven't already, create a
setup.cfg
file to move some of the configuration out ofsetup.py
. This helps with future compatibility. -
In
setup.cfg
, add an[options]
section and specifyzip_safe = False
. This ensures that the package is installed in a way that's compatible with editable installs:[options] zip_safe = False
-
If you're using any
setup.py
commands, consider moving them tosetup.cfg
or implementing them assetuptools
entry points. -
Update your installation instructions to recommend using pip's latest version:
pip install --upgrade pip pip install -e .
-
If users still encounter issues, they can use the
--config-settings editable_mode=compat
flag:pip install -e . --config-settings editable_mode=compat
These changes should allow users to perform editable installs without additional flags in most cases, while also providing a fallback option for compatibility mode.
Remember to test these changes thoroughly with different pip versions and Python environments to ensure they work as expected.
By implementing these suggestions, you're moving towards a more modern packaging setup while still maintaining compatibility with setup.py
and not requiring users to add extra flags for standard editable installs.