Repository navigation
Use recorded member defaults for frozen sync - #22015
charliermarsh merged 1 commit into
Conversation
This comment has been minimized.
This comment has been minimized.
3539d81 to
614843f
Compare
614843f to
7d2fcf5
Compare
7d2fcf5 to
b59b814
Compare
b59b814 to
4990821
Compare
4990821 to
1012024
Compare
1012024 to
35ba38e
Compare
35ba38e to
e549ddd
Compare
e549ddd to
90ebf9a
Compare
90ebf9a to
e31f4d4
Compare
e31f4d4 to
3312e7d
Compare
96e40ca to
7d9860a
Compare
7d9860a to
d3205c4
Compare
d3205c4 to
57e4805
Compare
57e4805 to
951273d
Compare
951273d to
9d196b8
Compare
9d196b8 to
48f3e10
Compare
| let selected = lock | ||
| .member_group_metadata() | ||
| .into_iter() | ||
| .flatten() | ||
| .filter(|(member, _)| { | ||
| target.roots().any(|root| root == *member) || target.group_root(groups) == Some(*member) | ||
| }) | ||
| .flat_map(|(member, metadata)| { | ||
| metadata | ||
| .iter() | ||
| .filter(move |(group, _)| target.includes_group(Some(member), group, groups)) | ||
| .filter_map(move |(group, metadata)| { | ||
| metadata.requires_python.as_ref().map(|requires_python| { | ||
| ( | ||
| (member.clone(), Some(group.clone())), | ||
| requires_python.clone(), | ||
| ) | ||
| }) | ||
| }) | ||
| }) | ||
| .collect::<RequiresPythonSources>(); |
There was a problem hiding this comment.
Maybe it's just because I'm not reviewing with an LSP to see the types, but I'm having a really hard time groking this transformation. It may benefit from a couple inline comments.
48f3e10 to
7a1d149
Compare
| source, | ||
| PythonRequirementSource::Workspace(workspace, groups), | ||
| ) | ||
| } |
There was a problem hiding this comment.
Why are we retaining this interface if it's a trivial wrapper?
| } | ||
|
|
||
| /// Validate an interpreter against a requirement and report its conflicting sources. | ||
| fn validate_python_requirement( |
There was a problem hiding this comment.
Nit since the validator function is preexisting, but it might be nice to try to require validatation by construction in a follow-up
| The following requirements in `uv.lock` do not permit this version: | ||
| - lockfile: >=3.13 | ||
| - member:docs: >=3.14 | ||
| Use `uv python pin` to update the `.python-version` file to a compatible version |
There was a problem hiding this comment.
aside: This rendering is... crazy? Why isn't this indented? Why isn't "Use uv python pin" a hint: sigh
Merging this PR will not alter performance
Comparing Footnotes
|
Summary
uv sync --package memberuses the selected member's default dependency groups, but adding--frozenmakes us use the defaults of the project we're running from instead.For example, when run from a workspace root whose defaults are
["dev"], we selectdeveven if the requested member's defaults are["docs"]. The same package selection can therefore install different dependencies depending on whether you pass--frozen.For revision 5 and later lockfiles, frozen sync uses the selected member's recorded default groups and group Python requirements, including when the member's manifest is missing.