Validate build dependencies when using `--no-build-isolation`
See original GitHub issueWhat’s the problem this feature will solve?
Prevent builds from running when all required build dependencies are not present.
Describe the solution you’d like
pip
fails to build with a descriptive message when a build dependency is missing, providing a nicer user experience (IMHO).
Alternative Solutions
- Use python-build which does exactly that.
- Manually parse pyproject.toml + generate egg info, get additional build requires and validate those are in the environment.
Additional context
I see the pip docs on --no-build-isolation
state “Build dependencies specified by PEP 518 must be already installed if this option is used.”. I was wondering whether pip would like to mimic the behaviour that python-build
has on --no-isolation
(Fail nicely if build dependencies are not present) and if so I’m happy to try and push a patch.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
python - pip install --no-build-isolation returns no such option
It is from pip documentation v21.1.3, check your pip version. If you need upgrade, use python -m pip install --upgrade pip.
Read more >Pip download (just the source packages, no building, no ...
Hi. Sometimes all I want is the source for modules - and I'll work out the dependencies later - manually. So, I have...
Read more >pyproject.toml - pip documentation v22.3.1
For building packages using this interface, pip uses an isolated environment. That is, pip will install build-time Python dependencies in a temporary ...
Read more >Dependency Scanning - GitLab Docs
If you use your own runners, make sure your installed version of Docker is not 19.03.0 . See troubleshooting information for details. Dependency...
Read more >Installing the development version of scikit-learn
Build the project with pip in Editable mode: pip install --verbose --no-build-isolation --editable . Check that the installed scikit-learn ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
A sanity check to make sure the user actually sets up the environment correctly makes sense to me.
The change needed here is calling
build_env.check_requirements(build_deps)
at some point in the codebase, since https://github.com/pypa/pip/blob/main/src/pip/_internal/build_env.py#L158 has the relevant logic already IIUC.I’m pretty sure the things to figure out here are:
build_deps
to make that call.