PEP 518 introduced the pyproject.toml file, as well as a section describing the tools needed to build:
[build-system]
requires = ["setuptools", "wheel", "numpy>=1.13"]
Here, I'm telling the build system (implicitly setuptools) that I need these three requirements installed before I can run the build. (And yes, I actually do need numpy as part of the build process.)
When I run pip wheel, it knows to look for this section in this file, install the requirements, and then build the wheel. But pip has no way to create an sdist distribution (and its maintainers seem reluctant to add one), so I need to run python setup.py sdist. And that's where the problem comes in: setup.py doesn't know it needs numpy, and the build fails.
Is there a standard way to just install the requirements, and then build an sdist? In particular, pip has moved toward build isolation, so can this be done with isolation? Failing that, I could create my own environment for some isolation; then, what's the best way to install the requirements in some environment?