It is up to the tool to decide how to handle [a pyproject.toml file without the build-system table]. Potential options are:
Act as if the pyproject.toml file does not exist.
Assume the table exists with the default values specified above.
IMO this has potential for unnecessarily confusion. In practice most would simply follow pip’s behaviour (1. if the table is missing entirely; 2. if the table exists but misses values). Why not specify that?
IMO, largely because we don’t (certainly didn’t at the time) know for certain whether pip’s behaviour is correct, and want to leave the option open for experimentation. Also, it’s much easier just to change pip if it turns out the current behaviour is problematic than it would be to change PEP 518.
Having said all that, I won’t object if someone wants to make the PEP require the same behaviour as pip.
IIRC pip’s behaviour is to trigger build isolation if pyproject.toml exists, and fill in missing fields with default values (i.e. option 2. in PEP 518).
If this proposal is to go anywhere, someone needs to confirm that for certain. And the PEP needs to explain the required behaviour without reference to pip (specifically, the justification for the mandated behaviour needs to stand on its own, and not be “because that’s what pip does”).
Also, be careful here - build isolation is not a PEP 518 concept. The idea of an isolated build environment is from PEP 517, and pip’s triggering it based on the existence of pyproject.toml choice is a tool-specific choice not covered by either of the PEPs1 (regardless of whether this clarification is made). The real question here is whether tools are required to treat projects as having opted in to PEP 518 if a pyproject.toml exists - even if that’s only for an unrelated reason such as black configuration.
1 Build isolation in PEP 517 is recommended, but optional.
And it is that switch to isolated builds that caused issues for black and seems to be a reason for other tools to hold off on pyproject.toml adoption (the other reason cited being the lack of a stdlib toml parser).
Do note that the PEP is marked as experimental so technically no one has to follow the PEP.
Since no one is worried enough to verify then I think it’s reasonable to assume that this is how pip operates.
Proposal
Tools should not require the existence of the [build-system] table. A pyproject.toml file may be used to store configuration details other than build-related data and thus lack a [build-system] table legitimately. If the file exists but is lacking the [build-system] table then the default values as specified above should be used. If the table is specified but is missing required fields then the tool should consider it an error.
What do people think of that as the change to that section of the PEP?