mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-18 06:18:53 +00:00
Add extra-build-dependencies
(#14735)
Replaces https://github.com/astral-sh/uv/pull/14092 Adds `tool.uv.extra-build-dependencies = {package = [dependency, ...]}` which extends `build-system.requires` during package builds. These are lowered via workspace sources, are applied to transitive dependencies, and are included in the wheel cache shard hash. There are some features we need to follow-up on, but are out of scope here: - Preferring locked versions for build dependencies - Settings for requiring locked versions for build depencies There are some quality of life follow-ups we should also do: - Warn on `extra-build-dependencies` that do not apply to any packages - Add test cases and improve error messaging when the `extra-build-dependencies` resolve fails ------- There ~are~ were a few open decisions to be made here 1. Should we resolve these dependencies alongside the `build-system.requires` dependencies? Or should we resolve separately? (I think the latter is more powerful? because you can override things? but it opens the door to breaking your build) 2. Should we install these dependencies into the same environment? Or should we layer it on top as we do elsewhere? (I think it's fine to install into the same environment) 3. Should we respect sources defined in the parent project? (I think yes, but then we need to lower the dependencies earlier — I don't think that's a big deal, but it's not implemented) 4. Should we respect sources defined in the child project? (I think no, this gets really complicated and seems weird to allow) 5. Should we apply this to transitive dependencies? (I think so) --------- Co-authored-by: Aria Desires <aria.desires@gmail.com> Co-authored-by: konstin <konstin@mailbox.org>
This commit is contained in:
parent
17f0c91896
commit
6856a27711
46 changed files with 1744 additions and 194 deletions
|
@ -354,6 +354,7 @@ pub fn resolver_options(
|
|||
}),
|
||||
no_build_isolation: flag(no_build_isolation, build_isolation, "build-isolation"),
|
||||
no_build_isolation_package: Some(no_build_isolation_package),
|
||||
extra_build_dependencies: None,
|
||||
exclude_newer: ExcludeNewer::from_args(
|
||||
exclude_newer,
|
||||
exclude_newer_package.unwrap_or_default(),
|
||||
|
@ -475,6 +476,7 @@ pub fn resolver_installer_options(
|
|||
} else {
|
||||
Some(no_build_isolation_package)
|
||||
},
|
||||
extra_build_dependencies: None,
|
||||
exclude_newer,
|
||||
exclude_newer_package: exclude_newer_package.map(ExcludeNewerPackage::from_iter),
|
||||
link_mode,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue