pip: PEP 518: Behavior when pyproject.toml doesn't have build-system.requires

https://github.com/pypa/pip/blob/018f03aab448231462b6c013a65d60a35e06e65a/src/pip/_internal/req/req_install.py#L450

If other @pypa/pip-committers think it’s a good idea, we should not isolate if there’s no build-system.requires in the pyproject.toml file.

This isn’t something I noticed earlier but maybe this would have eased transitions (prevented issues like the one with pandas). I still think it would be a good idea to do this.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 36 (35 by maintainers)

Commits related to this issue

Most upvoted comments

My intent is to bring pip in line with the PEP. I like what @pfmoore proposes as a compromise since it seems a lot of tools have come to rely upon non-compliant pyproject.toml files now. It also gives users the opportunity to push to update PEP 518 if having the “build-system.requires” key is to be made optional.

As long as we come around to being in compliance with what the PEP says eventually (read by the end of this year) I’m happy. 😃

Okay then. With #5626 and #5627, we’re in compliance with PEP 518.

PEP 518 now allows packages to omit the build-system table entirely and pip is going to currently isolate when the table is missing – treating it the same as ["setuptools", "wheel"] and building it in isolation.

It seems to me that it’s clear what we want to do here: pyproject.toml files without a build-system.requires are not valid per se; after a standard deprecation, we’ll start erroring out in that scenario.

/cc @brettcannon

@pradyunsg I agree. I’m not 100% clear what use cases there are for a pyproject.toml that doesn’t contain build-system.requires - the only one I’m aware of is that I think black uses pyproject.toml for configuration (which is allowed by PEP 518, but only with a compliant pyproject.toml).

If it’s just people using the “you can put project config in here” part of PEP 518 without following the full spec, I’m +1 on rejecting pyproject.toml if it doesn’t contain the mandatory build-system.requires key. If people want to be able to do this, they should get the PEP updated first.

And yes, it is pushy, but “please conform to the standards we took ages to define, when using a brand new file that never existed before the standard” seems like a perfectly OK point to be pushy on 😄