You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Is the section about setuptools and wheel required to build from source still relevant? #1517
While pip alone is sufficient to install from pre-built binary archives, up to date copies of the setuptools and wheel projects are useful to ensure you can also install from source archives
With PEP 517 now supported, is this still relevant? If not, I can push a PR removing it.
If I am not mistaken, when the project does not contain pyproject.toml, pip uses some internal heuristics (that depend on the state of the virtual/global environment) to determine whether to use build isolation.
My interpretation is that if the project does not have a pyproject.toml file, and/or is not tested against build isolation, it is still useful to install setuptools and wheel.
In fact we received a couple of related issues later in setuptools because some users still want to use "non-isolated" builds, but the latest versions of virtualenv, venv, etc no longer pre-install wheel by default1.
Maybe the text could be improved, but I think that the information is somehow relevant for people that did not complete the transition yet.
Footnotes
So we have to clarify that they are missing this step. ↩
If I am not mistaken, when the project does not contain pyproject.toml, pip uses some internal heuristics (that depend on the state of the virtual/global environment) to determine whether to use build isolation.
And use the APIs defined in PEP 517/660. This is probably what you are mentioning.
Don't use any PEP 517/660 APIs, instead just run python setup.py sdist and python setup.oy bdist_wheel in the current environment (global/virtual).
The choice between (1) and (2) varies depending on the state of the global/virtual environment and it is governed by pip's internal heuristics. But note that the behaviour in 1 and 2 are fundamentally different.
I suppose that pip's plan is to eventually retire (2), but last time I checked it was still being used.
I suppose that pip's plan is to eventually retire (2), but last time I checked it was still being used.
Indeed, the relevant code seems to be defined here
When no pyproject is available: if the user hasn't specified whether he'd like to use PEP517 andsetuptoolsorwheel is available, PEP517 will not be used, and I don't have the bigger picture but I guess it will use the installed version of setuptools/wheel to install the library.
My interpretation is that if the project does not have a pyproject.toml file, and/or is not tested against build isolation, it is still useful to install setuptools and wheel.
So with what was said above, I guess it makes sense to indicate you should have up to date versions of setuptools and wheelif you already have them installed in your environment (which is going to be less common with Python 3.12 not shipping setuptools anymore), but it is probably not necessary if you don't have them installed, as pip will fallback to build isolation? Not sure how to phrase this if we want to edit this section of the docs.
Activity
abravalheri commentedon Mar 5, 2024
If I am not mistaken, when the project does not contain
pyproject.toml,pipuses some internal heuristics (that depend on the state of the virtual/global environment) to determine whether to use build isolation.My interpretation is that if the project does not have a
pyproject.tomlfile, and/or is not tested against build isolation, it is still useful to installsetuptoolsandwheel.In fact we received a couple of related issues later in
setuptoolsbecause some users still want to use "non-isolated" builds, but the latest versions ofvirtualenv,venv, etc no longer pre-installwheelby default1.Maybe the text could be improved, but I think that the information is somehow relevant for people that did not complete the transition yet.
Footnotes
So we have to clarify that they are missing this step. ↩
chrysle commentedon Mar 8, 2024
Looks like it just assumes
setuptoolsis the build backend (see https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/#fallback-behaviour)? But probably that behaviour is limited to projects containing apyproject.tomlfile.I agree with that.
abravalheri commentedon Mar 8, 2024
Not really, it is more complex than that...
That is the planned fallback behaviour for the future, but right now
piphas 2 fallback modes.python setup.py sdistandpython setup.oy bdist_wheelin the current environment (global/virtual).The choice between (1) and (2) varies depending on the state of the global/virtual environment and it is governed by
pip's internal heuristics. But note that the behaviour in 1 and 2 are fundamentally different.I suppose that
pip's plan is to eventually retire (2), but last time I checked it was still being used.Viicos commentedon Mar 14, 2024
Indeed, the relevant code seems to be defined here
When no pyproject is available: if the user hasn't specified whether he'd like to use PEP517 and
setuptoolsorwheelis available, PEP517 will not be used, and I don't have the bigger picture but I guess it will use the installed version ofsetuptools/wheelto install the library.So with what was said above, I guess it makes sense to indicate you should have up to date versions of
setuptoolsandwheelif you already have them installed in your environment (which is going to be less common with Python 3.12 not shippingsetuptoolsanymore), but it is probably not necessary if you don't have them installed, aspipwill fallback to build isolation? Not sure how to phrase this if we want to edit this section of the docs.