mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Add a lock target abstraction (#10129)
## Summary This PR introduces a `LockTarget`, which is peer to `InstallTarget` and enables us to capture the common functionality necessary to support locking. For now, to minimize changes, only the `Workspace` target is implemented. In a future PR, I'll add a `Script` target for both locking and installing.
This commit is contained in:
parent
7c47a457d9
commit
f872b56124
11 changed files with 329 additions and 194 deletions
|
@ -278,7 +278,7 @@ impl Workspace {
|
|||
.any(|member| *member.root() == self.install_path)
|
||||
}
|
||||
|
||||
/// Returns the set of requirements that include all packages in the workspace.
|
||||
/// Returns the set of all workspace members.
|
||||
pub fn members_requirements(&self) -> impl Iterator<Item = Requirement> + '_ {
|
||||
self.packages.values().filter_map(|member| {
|
||||
let url = VerbatimUrl::from_absolute_path(&member.root)
|
||||
|
@ -309,7 +309,7 @@ impl Workspace {
|
|||
})
|
||||
}
|
||||
|
||||
/// Returns the set of requirements that include all packages in the workspace.
|
||||
/// Returns the set of all workspace member dependency groups.
|
||||
pub fn group_requirements(&self) -> impl Iterator<Item = Requirement> + '_ {
|
||||
self.packages.values().filter_map(|member| {
|
||||
let url = VerbatimUrl::from_absolute_path(&member.root)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue