-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add extra-build-dependencies
#14735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add extra-build-dependencies
#14735
Conversation
| fn sync_extra_build_dependencies() -> Result<()> { | ||
| let context = TestContext::new("3.12").with_filtered_counts(); | ||
|
|
||
| // Write a test package that arbitrarily requires `anyio` at build time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you <3 @konstin for the deranged test case
I would probably resolve them together. At least until we see a use-case to resolve them separately. (We could add build dependency overrides to allow explicit overrides, like we have build dependency constraints.)
Same environment IMO.
I think yes... I think we should respect the sources defined in the same file as the
I don't think so.
I think so, yeah. Similar to other settings, like |
ae3d08f to
1d2d9aa
Compare
9b52574 to
db10dcb
Compare
b44584e to
bd55fda
Compare
6d46b63 to
6c61c7f
Compare
| } | ||
|
|
||
| /// Create from pre-lowered dependencies (for non-workspace contexts). | ||
| pub fn from_lowered(extra_build_dependencies: ExtraBuildDependencies) -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this just be a From<ExtraBuildDependencies> impl?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This separate method avoids accidentally converting them without lowering
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think a dedicated method makes sense here.
| } | ||
| VersionOrUrl::Url(url) => { | ||
| 1u8.cache_key(state); | ||
| url.to_string().cache_key(state); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the to_string because it's generic? I wonder if we could require Pep508Url to impl CacheKey?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think so, I looked at it briefly and it the generic aspect seemed tricky.
charliermarsh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work.
| } | ||
|
|
||
| /// Create from pre-lowered dependencies (for non-workspace contexts). | ||
| pub fn from_lowered(extra_build_dependencies: ExtraBuildDependencies) -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This separate method avoids accidentally converting them without lowering
cf66317 to
3d2e5fc
Compare
3d2e5fc to
285b8b2
Compare
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.8.3` -> `0.8.4` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>astral-sh/uv (astral-sh/uv)</summary> ### [`v0.8.4`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#084) [Compare Source](astral-sh/uv@0.8.3...0.8.4) ##### Enhancements - Improve styling of warning cause chains ([#​14934](astral-sh/uv#14934)) - Extend wheel filtering to Android tags ([#​14977](astral-sh/uv#14977)) - Perform wheel lockfile filtering based on platform and OS intersection ([#​14976](astral-sh/uv#14976)) - Clarify messaging when a new resolution needs to be performed ([#​14938](astral-sh/uv#14938)) ##### Preview features - Add support for extending package's build dependencies with `extra-build-dependencies` ([#​14735](astral-sh/uv#14735)) - Split preview mode into separate feature flags ([#​14823](astral-sh/uv#14823)) ##### Configuration - Add support for package specific `exclude-newer` dates via `exclude-newer-package` ([#​14489](astral-sh/uv#14489)) ##### Bug fixes - Avoid invalidating lockfile when path or workspace dependencies define explicit indexes ([#​14876](astral-sh/uv#14876)) - Copy entrypoints that have a shebang that differs in `python` vs `python3` ([#​14970](astral-sh/uv#14970)) - Fix incorrect file permissions in wheel packages ([#​14930](astral-sh/uv#14930)) - Update validation for `environments` and `required-environments` in `uv.toml` ([#​14905](astral-sh/uv#14905)) ##### Documentation - Show `uv_build` in projects documentation ([#​14968](astral-sh/uv#14968)) - Add `UV_` prefix to installer environment variables ([#​14964](astral-sh/uv#14964)) - Un-hide `uv` from `--build-backend` options ([#​14939](astral-sh/uv#14939)) - Update documentation for preview flags ([#​14902](astral-sh/uv#14902)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS40NS4wIiwidXBkYXRlZEluVmVyIjoiNDEuNDUuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Replaces #14092
Adds
tool.uv.extra-build-dependencies = {package = [dependency, ...]}which extendsbuild-system.requiresduring 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:
There are some quality of life follow-ups we should also do:
extra-build-dependenciesthat do not apply to any packagesextra-build-dependenciesresolve failsThere
arewere a few open decisions to be made herebuild-system.requiresdependencies? 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)