Skip to content

Commit

Permalink
Deprecate the --isolated flag
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Jul 26, 2024
1 parent bebf492 commit 36b2f4d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 30 deletions.
2 changes: 1 addition & 1 deletion crates/uv-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ pub struct GlobalArgs {

/// Avoid discovering a `pyproject.toml` or `uv.toml` file in the current directory or any
/// parent directories.
#[arg(global = true, long)]
#[arg(global = true, long, hide = true)]
pub isolated: bool,

/// Show the resolved settings for the current command.
Expand Down
9 changes: 9 additions & 0 deletions crates/uv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use uv_cli::{SelfCommand, SelfNamespace};
use uv_configuration::Concurrency;
use uv_requirements::RequirementsSource;
use uv_settings::{Combine, FilesystemOptions};
use uv_warnings::warn_user;
use uv_workspace::{DiscoveryOptions, Workspace};

use crate::commands::{ExitStatus, ToolRunCommand};
Expand Down Expand Up @@ -136,6 +137,14 @@ async fn run(cli: Cli) -> Result<ExitStatus> {
)
}))?;

if globals.isolated {
if globals.preview.is_enabled() {
warn_user!("The `--isolated` flag is deprecated. Instead, use `--no-config` to prevent uv from discovering configuration files, or `--no-workspace` to prevent uv from discovering a workspace in `uv run` and other commands.");
} else {
warn_user!("The `--isolated` flag is deprecated. Instead, use `--no-config` to prevent uv from discovering configuration files.");
}
}

debug!("uv {}", version::version());

// Write out any resolved settings.
Expand Down
29 changes: 0 additions & 29 deletions crates/uv/tests/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ fn help() {
--python-fetch <PYTHON_FETCH>
Whether to automatically download Python when required [possible values: automatic,
manual]
--isolated
Avoid discovering a `pyproject.toml` or `uv.toml` file in the current directory or any
parent directories
--no-progress
Hides all progress outputs when set
-n, --no-cache
Expand Down Expand Up @@ -109,9 +106,6 @@ fn help_flag() {
--python-fetch <PYTHON_FETCH>
Whether to automatically download Python when required [possible values: automatic,
manual]
--isolated
Avoid discovering a `pyproject.toml` or `uv.toml` file in the current directory or any
parent directories
--no-progress
Hides all progress outputs when set
-n, --no-cache
Expand Down Expand Up @@ -174,9 +168,6 @@ fn help_short_flag() {
--python-fetch <PYTHON_FETCH>
Whether to automatically download Python when required [possible values: automatic,
manual]
--isolated
Avoid discovering a `pyproject.toml` or `uv.toml` file in the current directory or any
parent directories
--no-progress
Hides all progress outputs when set
-n, --no-cache
Expand Down Expand Up @@ -280,10 +271,6 @@ fn help_subcommand() {
- manual: Do not automatically fetch managed Python installations; require explicit
installation
--isolated
Avoid discovering a `pyproject.toml` or `uv.toml` file in the current directory or any
parent directories
--no-progress
Hides all progress outputs when set
Expand Down Expand Up @@ -408,10 +395,6 @@ fn help_subsubcommand() {
- manual: Do not automatically fetch managed Python installations; require explicit
installation
--isolated
Avoid discovering a `pyproject.toml` or `uv.toml` file in the current directory or any
parent directories
--no-progress
Hides all progress outputs when set
Expand Down Expand Up @@ -490,9 +473,6 @@ fn help_flag_subcommand() {
--python-fetch <PYTHON_FETCH>
Whether to automatically download Python when required [possible values: automatic,
manual]
--isolated
Avoid discovering a `pyproject.toml` or `uv.toml` file in the current directory or any
parent directories
--no-progress
Hides all progress outputs when set
-n, --no-cache
Expand Down Expand Up @@ -552,9 +532,6 @@ fn help_flag_subsubcommand() {
--python-fetch <PYTHON_FETCH>
Whether to automatically download Python when required [possible values: automatic,
manual]
--isolated
Avoid discovering a `pyproject.toml` or `uv.toml` file in the current directory or any
parent directories
--no-progress
Hides all progress outputs when set
-n, --no-cache
Expand Down Expand Up @@ -671,9 +648,6 @@ fn help_with_global_option() {
--python-fetch <PYTHON_FETCH>
Whether to automatically download Python when required [possible values: automatic,
manual]
--isolated
Avoid discovering a `pyproject.toml` or `uv.toml` file in the current directory or any
parent directories
--no-progress
Hides all progress outputs when set
-n, --no-cache
Expand Down Expand Up @@ -770,9 +744,6 @@ fn test_with_no_pager() {
--python-fetch <PYTHON_FETCH>
Whether to automatically download Python when required [possible values: automatic,
manual]
--isolated
Avoid discovering a `pyproject.toml` or `uv.toml` file in the current directory or any
parent directories
--no-progress
Hides all progress outputs when set
-n, --no-cache
Expand Down
1 change: 1 addition & 0 deletions crates/uv/tests/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ fn init_isolated() -> Result<()> {
----- stdout -----
----- stderr -----
warning: The `--isolated` flag is deprecated. Instead, use `--no-config` to prevent uv from discovering configuration files.
warning: `uv init` is experimental and may change without warning
Initialized project `foo`
"###);
Expand Down

0 comments on commit 36b2f4d

Please sign in to comment.