Skip to content

Commit

Permalink
Reverts
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Sep 10, 2024
1 parent 8e4e55b commit 7eabe6d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
5 changes: 0 additions & 5 deletions crates/uv-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2536,11 +2536,6 @@ pub struct SyncArgs {
#[arg(long, overrides_with("dev"))]
pub no_dev: bool,

// /// Omit non-development dependencies.
// ///
// /// The project itself will also be omitted.
// #[arg(long, conflicts_with("no_dev"))]
// pub only_dev: bool,
/// Do not remove extraneous packages present in the environment.
///
/// When enabled, uv will make the minimum necessary changes to satisfy the requirements.
Expand Down
32 changes: 24 additions & 8 deletions crates/uv-configuration/src/install_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,41 @@ impl InstallOptions {
project_name: Option<&PackageName>,
members: &BTreeSet<PackageName>,
) -> bool {
// If `--no-install-project` is set, remove the project itself. The project is always
// part of the workspace.
if self.no_install_project || self.no_install_workspace {
// If `--no-install-project` is set, remove the project itself.
if self.no_install_project {
if let Some(project_name) = project_name {
if package == project_name {
debug!("Omitting `{package}` from resolution due to `--no-install-project`");
return false;
}
} else {
debug!("Ignoring `--no-install-project` for virtual workspace");
};
}
}

// If `--no-install-workspace` is set, remove the project and any workspace members.
if self.no_install_workspace && members.contains(package) {
return false;
if self.no_install_workspace {
// In some cases, the project root might be omitted from the list of workspace members
// encoded in the lockfile. (But we already checked this above if `--no-install-project`
// is set.)
if !self.no_install_project {
if let Some(project_name) = project_name {
if package == project_name {
debug!(
"Omitting `{package}` from resolution due to `--no-install-workspace`"
);
return false;
}
}
}

if members.contains(package) {
debug!("Omitting `{package}` from resolution due to `--no-install-workspace`");
return false;
}
}

// If `--no-install-package` is provided, remove the requested packages.
if self.no_install_package.contains(package) {
debug!("Omitting `{package}` from resolution due to `--no-install-package`");
return false;
}

Expand Down

0 comments on commit 7eabe6d

Please sign in to comment.