Skip to content

Commit

Permalink
Collapse if
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Aug 8, 2024
1 parent c62ce0c commit 4c39fc8
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 39 deletions.
10 changes: 4 additions & 6 deletions crates/uv/src/commands/pip/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,11 @@ pub(crate) async fn pip_compile(
let build_isolation = if no_build_isolation {
environment = PythonEnvironment::from_interpreter(interpreter.clone());
BuildIsolation::Shared(&environment)
} else if no_build_isolation_package.is_empty() {
BuildIsolation::Isolated
} else {
if no_build_isolation_package.is_empty() {
BuildIsolation::Isolated
} else {
environment = PythonEnvironment::from_interpreter(interpreter.clone());
BuildIsolation::SharedPackage(&environment, &no_build_isolation_package)
}
environment = PythonEnvironment::from_interpreter(interpreter.clone());
BuildIsolation::SharedPackage(&environment, &no_build_isolation_package)
};

let build_dispatch = BuildDispatch::new(
Expand Down
8 changes: 3 additions & 5 deletions crates/uv/src/commands/pip/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,10 @@ pub(crate) async fn pip_install(
// Determine whether to enable build isolation.
let build_isolation = if no_build_isolation {
BuildIsolation::Shared(&environment)
} else if no_build_isolation_package.is_empty() {
BuildIsolation::Isolated
} else {
if no_build_isolation_package.is_empty() {
BuildIsolation::Isolated
} else {
BuildIsolation::SharedPackage(&environment, &no_build_isolation_package)
}
BuildIsolation::SharedPackage(&environment, &no_build_isolation_package)
};

// Initialize any shared state.
Expand Down
8 changes: 3 additions & 5 deletions crates/uv/src/commands/pip/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,10 @@ pub(crate) async fn pip_sync(
// Determine whether to enable build isolation.
let build_isolation = if no_build_isolation {
BuildIsolation::Shared(&environment)
} else if no_build_isolation_package.is_empty() {
BuildIsolation::Isolated
} else {
if no_build_isolation_package.is_empty() {
BuildIsolation::Isolated
} else {
BuildIsolation::SharedPackage(&environment, &no_build_isolation_package)
}
BuildIsolation::SharedPackage(&environment, &no_build_isolation_package)
};

// Initialize any shared state.
Expand Down
10 changes: 4 additions & 6 deletions crates/uv/src/commands/project/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,11 @@ async fn do_lock(
let build_isolation = if no_build_isolation {
environment = PythonEnvironment::from_interpreter(interpreter.clone());
BuildIsolation::Shared(&environment)
} else if no_build_isolation_package.is_empty() {
BuildIsolation::Isolated
} else {
if no_build_isolation_package.is_empty() {
BuildIsolation::Isolated
} else {
environment = PythonEnvironment::from_interpreter(interpreter.clone());
BuildIsolation::SharedPackage(&environment, no_build_isolation_package)
}
environment = PythonEnvironment::from_interpreter(interpreter.clone());
BuildIsolation::SharedPackage(&environment, no_build_isolation_package)
};

let options = OptionsBuilder::new()
Expand Down
28 changes: 11 additions & 17 deletions crates/uv/src/commands/project/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,13 +437,11 @@ pub(crate) async fn resolve_names(
let build_isolation = if *no_build_isolation {
environment = PythonEnvironment::from_interpreter(interpreter.clone());
BuildIsolation::Shared(&environment)
} else if no_build_isolation_package.is_empty() {
BuildIsolation::Isolated
} else {
if no_build_isolation_package.is_empty() {
BuildIsolation::Isolated
} else {
environment = PythonEnvironment::from_interpreter(interpreter.clone());
BuildIsolation::SharedPackage(&environment, no_build_isolation_package)
}
environment = PythonEnvironment::from_interpreter(interpreter.clone());
BuildIsolation::SharedPackage(&environment, no_build_isolation_package)
};

// TODO(charlie): These are all default values. We should consider whether we want to make them
Expand Down Expand Up @@ -555,13 +553,11 @@ pub(crate) async fn resolve_environment<'a>(
let build_isolation = if no_build_isolation {
environment = PythonEnvironment::from_interpreter(interpreter.clone());
BuildIsolation::Shared(&environment)
} else if no_build_isolation_package.is_empty() {
BuildIsolation::Isolated
} else {
if no_build_isolation_package.is_empty() {
BuildIsolation::Isolated
} else {
environment = PythonEnvironment::from_interpreter(interpreter.clone());
BuildIsolation::SharedPackage(&environment, no_build_isolation_package)
}
environment = PythonEnvironment::from_interpreter(interpreter.clone());
BuildIsolation::SharedPackage(&environment, no_build_isolation_package)
};

let options = OptionsBuilder::new()
Expand Down Expand Up @@ -861,12 +857,10 @@ pub(crate) async fn update_environment(
// Determine whether to enable build isolation.
let build_isolation = if *no_build_isolation {
BuildIsolation::Shared(&venv)
} else if no_build_isolation_package.is_empty() {
BuildIsolation::Isolated
} else {
if no_build_isolation_package.is_empty() {
BuildIsolation::Isolated
} else {
BuildIsolation::SharedPackage(&venv, no_build_isolation_package)
}
BuildIsolation::SharedPackage(&venv, no_build_isolation_package)
};

let options = OptionsBuilder::new()
Expand Down

0 comments on commit 4c39fc8

Please sign in to comment.