On Sun, Jun 24, 2018 at 10:50 AM Nathaniel Smith <njs@pobox.com> wrote:
To go a bit against the grain here, I think at this point I'd suggest
that if "build-system.requires" is missing, it should be silently
treated as if it had been set to ["setuptools", "wheel"]. Reasoning:

- Implementing this should require only a trivial amount of code, now
and in the long run. In particular, I'm *not* suggesting that if the
"build-system.requires" key is missing then we should act like
pyproject.toml is missing altogether -- that's a much more complex
legacy code path that we'd like to eventually remove. I'm suggesting
we literally do something like:

try:
    requires = config["build-system"]["requires"]
except KeyError:
    requires = ["setuptools", "wheel"]

and then treat them exactly the same from then on.

Defaulting to this behavior means that the way source distribution is
built changes (build isolation is enabled by pip) because configuration
for a tool was added. This is surprising for users since one of things
this means is they need to have provide wheels (so that pip that can
find/use them) for `setuptools` and `wheel` to install packages. We've
had multiple users report this on pip's tracker.

Having users specify their build-requirements explicitly is a stronger
opt-in that can used to explain the behavior in this case as that project
using PEP 518 and build-isolation vs that project has configuration for
towncrier. :)

The only other option is falling back to legacy behavior in this case,
which obviously isn't what we want here.

- Not doing this breaks a number of real projects. Sometimes this is
justifiable because we have to break things to make progress, but it
always creates busywork and pisses people off, so we should only do it
when we have a good reason. In this case providing a default value is
pretty trivial, and will prevent a lot of frustrated queries about why
it's mandatory.

- Providing a default doesn't really compromise the final vision for
the feature: we envision that eventually, pretty much every project
will be specifying this explicitly, and won't *want* to leave it
blank. There isn't any other meaning we want to assign to this being
left blank.

- We're soon going to have to jump through all these hoops *anyway*
for the PEP 517 "build-system.build-backend" key. If it's missing,
then we're going to want to default it to "setuptools" (once
setuptools exports a PEP 517 build backend), which means we're going
to be hardcoding some defaults and knowledge of setuptools into the
pyproject.toml defaults. So we might as well do this for both keys in
the same way.

-n​

Pradyun