From 01515c13328cba047b89db12f5d20ab25a8f2a20 Mon Sep 17 00:00:00 2001 From: Christopher Covington Date: Mon, 24 Jun 2024 16:41:57 -0400 Subject: [PATCH] Document PEP517 difference (#4480) ## Summary PEP 517 build isolation https://github.com/astral-sh/uv/pull/843 has not yet been mentioned in the PIP compatibility documentation. Add a section for it. ## Test Plan Visual inspection only ## Open Questions > in most cases, swapping out `pip install` for `uv pip install` should "just work". In the first non-trivial case I tried, it worked for a short time and then [started failing](https://github.com/astral-sh/uv/issues/4069#issuecomment-2186762048). Is there any data out there on how many top 100 or top 1000 packages work with PEP 517 build isolation? How can someone specify `--no-build-isolation` for just one package/line in `requirements.txt`? --------- Co-authored-by: Charlie Marsh --- PIP_COMPATIBILITY.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/PIP_COMPATIBILITY.md b/PIP_COMPATIBILITY.md index 0eab39404..3cbc4eded 100644 --- a/PIP_COMPATIBILITY.md +++ b/PIP_COMPATIBILITY.md @@ -147,6 +147,24 @@ In the future, uv will support pinning packages to dedicated indexes (see: [#171 Additionally, [PEP 708](https://peps.python.org/pep-0708/) is a provisional standard that aims to address the "dependency confusion" issue across package registries and installers. +## PEP 517 build isolation + +uv uses [PEP 517](https://peps.python.org/pep-0517/) build isolation by default (akin to `pip install --use-pep517`), +following `pypa/build` and in anticipation of `pip` defaulting to PEP 517 builds in the future ([pypa/pip#9175](https://github.com/pypa/pip/issues/9175)). + +If a package fails to install due to a missing build-time dependency, try using a newer version of the package; if the +problem persists, consider filing an issue with the package maintainer, requesting that they update the packaging setup +to declare the correct PEP 517 build-time dependencies. + +As an escape hatch, you can preinstall a package's build dependencies, then run `uv pip install` with +`--no-build-isolation`, as in: + +```shell +uv pip install wheel && uv pip install --no-build-isolation biopython==1.77 +``` + +For a list of packages that are known to fail under PEP 517 build isolation, see [#2252](https://github.com/astral-sh/uv/issues/2252). + ## Transitive direct URL dependencies for constraints and overrides While uv does support URL dependencies (e.g., `black @ https://...`), it does not support