Do we want to keep the `[build-system]` default for `pyproject.toml`?

FWIW, when the PEP517/PEP518 builds were implemented in Fedora, we copied pip’s behavior to only fallback to setuptools when there is a setup.py file. That behavior made sense to me, but it was not explicitly stated that way in the PEPs.

However, recently somebody reported that as a problem, stating that pip no longer requires existing setup.py file to default to setuptools when there is no build backend specified. This has happened in Fix PEP 660 metadata preparation fallback by sbidoul · Pull Request #10577 · pypa/pip · GitHub

I didn’t get back to changing the behavior in Fedora. I don’t think defaulting to setuptools without a setup.py file makes sense.


Context from PEP 517:

If the pyproject.toml file is absent, or the build-backend key is missing, the source tree is not using this specification, and tools should revert to the legacy behaviour of running setup.py (either directly, or by implicitly invoking the setuptools.build_meta:__legacy__ backend).

(Emphasis mine.)

From PEP 518:

If the file exists but is lacking the [build-system] table then the default values[1] as specified above should be used.


  1. requires = ["setuptools"] ↩︎

3 Likes