Skip to content
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

Use top-level --isolated for uv run #3431

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions crates/uv/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1824,10 +1824,6 @@ pub(crate) struct RunArgs {
#[arg(allow_hyphen_values = true)]
pub(crate) args: Vec<OsString>,

/// Always use a new virtual environment for execution.
#[arg(long)]
pub(crate) isolated: bool,
Comment on lines -1827 to -1829
Copy link
Member

@zanieb zanieb May 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (behavior) was useful for testing, but oh well I can add it back if I need it.


/// Run with the given packages installed.
#[arg(long)]
pub(crate) with: Vec<String>,
Expand All @@ -1851,11 +1847,6 @@ pub(crate) struct RunArgs {
group = "discovery"
)]
pub(crate) python: Option<String>,

/// Run without the current workspace installed.
#[arg(long)]
pub(crate) no_workspace: bool,
// TODO(zanieb): Consider alternative names like `--no-project` or `--without-project`
}

#[derive(Args)]
Expand Down
3 changes: 1 addition & 2 deletions crates/uv/src/commands/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ pub(crate) async fn run(
mut requirements: Vec<RequirementsSource>,
python: Option<String>,
isolated: bool,
no_workspace: bool,
preview: PreviewMode,
cache: &Cache,
printer: Printer,
Expand Down Expand Up @@ -80,7 +79,7 @@ pub(crate) async fn run(
// cannot be applied to transitive dependencies.
let overrides = requirements.clone();

if !no_workspace {
if !isolated {
if let Some(workspace_requirements) = find_workspace_requirements()? {
requirements.extend(workspace_requirements);
}
Expand Down
3 changes: 1 addition & 2 deletions crates/uv/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,7 @@ async fn run() -> Result<ExitStatus> {
args.args,
requirements,
args.python,
args.isolated,
args.no_workspace,
cli.isolated,
globals.preview,
&cache,
printer,
Expand Down
6 changes: 0 additions & 6 deletions crates/uv/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ pub(crate) struct RunSettings {
// CLI-only settings.
pub(crate) target: Option<String>,
pub(crate) args: Vec<OsString>,
pub(crate) isolated: bool,
pub(crate) with: Vec<String>,
pub(crate) no_workspace: bool,
pub(crate) python: Option<String>,
}

Expand All @@ -98,19 +96,15 @@ impl RunSettings {
let RunArgs {
target,
args,
isolated,
with,
no_workspace,
python,
} = args;

Self {
// CLI-only settings.
target,
args,
isolated,
with,
no_workspace,
python,
}
}
Expand Down
Loading