-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Deprecate legacy setup.py bdist_wheel
mechanism for building projects
#6334
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
Comments
Add setup.cfg and setup.py, necessary for installing a package via pip. Add a ReST document (PACKAGE.rst) explaining the basics of what this package is for and who to contact for more information. This document will be used as the landing page for the package on PyPI. List the subpackages we intend to package by name instead of using find_namespace because find_namespace will naively also packages tests, things it finds in the dist/ folder, etc. I could not figure out how to modify this behavior; adding allow/deny lists to setuptools kept changing the packaged hierarchy. This works, roll with it. I am not yet using a pyproject.toml style package manifest, because "editable" installs are not defined (yet?) by PEP-517/518. I consider editable installs crucial for development, though they have (apparently) always been somewhat poorly defined. Pip now (19.2 and later) now supports editable installs for projects using pyproject.toml manifests, but might require the use of the --no-use-pep517 flag, which somewhat defeats the point. Full support for setup.py-less editable installs was not introduced until pip 21.1.1: pypa/pip@7a95720 For now, while the dust settles, stick with the de-facto setup.py/setup.cfg combination supported by setuptools. It will be worth re-evaluating this point again in the future when our supported build platforms all ship a fairly modern pip. Additional reading on this matter: pypa/packaging-problems#256 pypa/pip#6334 pypa/pip#6375 pypa/pip#6434 pypa/pip#6438 Signed-off-by: John Snow <[email protected]> Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]> Reviewed-by: Cleber Rosa <[email protected]> Message-id: [email protected] Signed-off-by: John Snow <[email protected]>
Add setup.cfg and setup.py, necessary for installing a package via pip. Add a ReST document (PACKAGE.rst) explaining the basics of what this package is for and who to contact for more information. This document will be used as the landing page for the package on PyPI. List the subpackages we intend to package by name instead of using find_namespace because find_namespace will naively also packages tests, things it finds in the dist/ folder, etc. I could not figure out how to modify this behavior; adding allow/deny lists to setuptools kept changing the packaged hierarchy. This works, roll with it. I am not yet using a pyproject.toml style package manifest, because "editable" installs are not defined (yet?) by PEP-517/518. I consider editable installs crucial for development, though they have (apparently) always been somewhat poorly defined. Pip now (19.2 and later) now supports editable installs for projects using pyproject.toml manifests, but might require the use of the --no-use-pep517 flag, which somewhat defeats the point. Full support for setup.py-less editable installs was not introduced until pip 21.1.1: pypa/pip@7a95720 For now, while the dust settles, stick with the de-facto setup.py/setup.cfg combination supported by setuptools. It will be worth re-evaluating this point again in the future when our supported build platforms all ship a fairly modern pip. Additional reading on this matter: pypa/packaging-problems#256 pypa/pip#6334 pypa/pip#6375 pypa/pip#6434 pypa/pip#6438 Signed-off-by: John Snow <[email protected]> Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]> Reviewed-by: Cleber Rosa <[email protected]> Message-id: [email protected] Signed-off-by: John Snow <[email protected]>
This comment has been minimized.
This comment has been minimized.
setup.py bdist_wheel
mechanism for building projects for installation
setup.py bdist_wheel
mechanism for building projects for installationsetup.py bdist_wheel
mechanism for building projects
setup.py bdist_wheel
mechanism for building projectssetup.py bdist_wheel
mechanism for building projects
So for those who don't follow the PyPA Discord aggressively, I'm working on a mini-project to build a bunch of PyPI projects w/o a
On Python 3.13, the results are:
I'm planning to file PRs for the projects where enabling I wouldn't mind filing PRs for the ~200 projects over the six month span before pip 25.3, but I wouldn't want to waste time doing something isn't beneficial. I've always assumed that Python projects in 2025 really should have a I'm working on testing the top 10000 projects (with the same restrictions). I'll follow up with the results of that experiment. Of course, the real trouble lies with the non-pure Python projects, but that's a mess I haven't figured out how to study yet. |
Last updated on April 27, 2025.
What's being deprecated?
If you've received this deprecation warning, pip is using the
setup.py bdist_wheel
mechanism to build your project into a wheel for installation. This mechanism is legacy, deprecated, and slated for removal in pip 25.3 (Q4 2025).FOR CONTEXT: The
pyproject.toml
specification covers how to build projects that include the file without specifying the optional[build-system]
table. pip is now transitioning to this standard fallback mechanism when thepyproject.toml
file is omitted entirely (replacing its previously deprecated non-standard ad hoc fallback logic for that case). Most projects which omitpyproject.toml
will continue to build without problems after this change, but it's possible some projects will fail to build when using the standardised fallback mechanism (for example, due to undeclared build dependencies).Specificially, pip currently calls the
setup.py
file directly in order to build projects without apyproject.toml
. The direct use of thesetup.py
command-line interface is deprecated, in favour of the PEP 517 mechanism which specifies a standard way for installers to ask the build backend (like setuptools) to build a project.What should I do?
I am an USER of the affected project
You should report the deprecation warning to the project (if it has NOT already been reported!). Their packaging setup may need changes in order to be installable with future pip releases. You cannot fix this, only the project can.
Otherwise, you can silence the deprecation warning by force-enabling pip's PEP 517 mode, which will become the default and only installation method in the future. There are several ways to do this:
--use-pep517
flagPIP_USE_PEP517=true
environment variableGenerally, PEP 517 mode is mostly backwards compatible with the old
setup.py bdist_wheel
mechanism, however build isolation (see below) may cause build issues.Warning
The project may fail to build or install when PEP 517 mode is enabled. If this happens, the recommended course of action is to do nothing and wait for the project to release a fixed version. Until support for the
setup.py bdist_wheel
is removed in pip 25.3, pip will continue to be able to install affected projects without any issue.I am an AUTHOR of the affected project
You need to add a
pyproject.toml
file to your project. If you cannot add apyproject.toml
file, then follow the advice for USERS of affected projects above.Without this file, pip does not know that your project supports the PEP 517 mechanism which is the replacement for the deprecated
setup.py bdist_wheel
mechanism.In this file, you need to declare that your project is packaged using setuptools. You can add the following
pyproject.toml
to the root of your project, in the same folder that yoursetup.py
orsetup.cfg
is contained in.If the deprecation warning disappears, your project is being installed with the PEP 517 mechanism. Double check that the new installation functions correctly. If everything looks good, you're done. Congratulations!
Warning
By opting into pip's PEP 517 mode, you are also opting into build isolation. This means that pip will create a temporary Python environment to build the project in, whereas with the legacy behaviour the build occurs within the Python environment where pip is installed.
If your project needs specific dependencies (e.g., Cython) to be pre-installed for its build to function, it is recommended to declare them in
build-system.requires
inpyproject.toml
.If this is not possible, you can disable build isolation by passing the
--no-build-isolation
option. You are then responsible for ensuring the local environment has all dependencies needed for installation.Important
The
setup.py
file is NOT deprecated. It is perfectly fine to keep yoursetup.py
(orsetup.cfg
) file to configure setuptools for your project. However, if you wish, you can migrate your project's packaging configuration to thepyproject.toml
file.Tip
If you're struggling to reproduce the deprecation warning, double check that setuptools is installed. If setuptools is not installed, pip will always use the PEP 517 mechanism (and enable build isolation) as the
setup.py bdist_wheel
mechanism relies on setuptools being available.Original issue text (for pip maintainers)
This is a longer-term goal, not something that can be done without a carefully managed transition, but pip should remove support for building and installing packages without using PEP 517.
Before this can be done, we need to be sure that PEP 517 support is complete, and there are no edge cases remaining of projects that cannot build with PEP 517, but need the legacy path. There is also an open question on how we provide editable install support, which is not covered by PEP 517.
I have raised this issue so that we have a central point to link to which makes it clear that this is the intended long term goal.
The text was updated successfully, but these errors were encountered: