From 905aa859e80e71e3fb47c08e3c5a70d0cf70c8d0 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Thu, 25 Jul 2024 20:14:12 -0400 Subject: [PATCH] Deprecate the --isolated flag --- .github/workflows/sync-python-releases.yml | 4 +-- crates/uv-cli/src/lib.rs | 2 +- crates/uv-python/fetch-download-metadata.py | 2 +- .../uv-python/template-download-metadata.py | 2 +- crates/uv/src/lib.rs | 9 ++++++ crates/uv/tests/help.rs | 29 ------------------- crates/uv/tests/init.rs | 1 + scripts/release.sh | 4 +-- 8 files changed, 17 insertions(+), 36 deletions(-) diff --git a/.github/workflows/sync-python-releases.yml b/.github/workflows/sync-python-releases.yml index c6c1d38ecec5..e5340601f177 100644 --- a/.github/workflows/sync-python-releases.yml +++ b/.github/workflows/sync-python-releases.yml @@ -20,8 +20,8 @@ jobs: - uses: hynek/setup-cached-uv@v2 - name: Sync Python Releases run: | - uv run --isolated -- fetch-download-metadata.py - uv run --isolated -- template-download-metadata.py + uv run -- fetch-download-metadata.py + uv run -- template-download-metadata.py working-directory: ./crates/uv-python env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index f17298c57536..6485dc2a58b0 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -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. diff --git a/crates/uv-python/fetch-download-metadata.py b/crates/uv-python/fetch-download-metadata.py index 1715a967e807..472669781be3 100755 --- a/crates/uv-python/fetch-download-metadata.py +++ b/crates/uv-python/fetch-download-metadata.py @@ -11,7 +11,7 @@ Usage: - uv run --isolated -- crates/uv-python/fetch-download-metadata.py + uv run -- crates/uv-python/fetch-download-metadata.py Acknowledgements: diff --git a/crates/uv-python/template-download-metadata.py b/crates/uv-python/template-download-metadata.py index 6f21855a1578..948c2abf5bf7 100755 --- a/crates/uv-python/template-download-metadata.py +++ b/crates/uv-python/template-download-metadata.py @@ -11,7 +11,7 @@ Usage: - uv run --isolated -- crates/uv-python/template-download-metadata.py + uv run -- crates/uv-python/template-download-metadata.py """ import argparse diff --git a/crates/uv/src/lib.rs b/crates/uv/src/lib.rs index 86a646d9453e..19177769f5a8 100644 --- a/crates/uv/src/lib.rs +++ b/crates/uv/src/lib.rs @@ -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}; @@ -136,6 +137,14 @@ async fn run(cli: Cli) -> Result { ) }))?; + 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. diff --git a/crates/uv/tests/help.rs b/crates/uv/tests/help.rs index ae95fa5834f4..3178c148dd5a 100644 --- a/crates/uv/tests/help.rs +++ b/crates/uv/tests/help.rs @@ -43,9 +43,6 @@ fn help() { --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 @@ -109,9 +106,6 @@ fn help_flag() { --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 @@ -174,9 +168,6 @@ fn help_short_flag() { --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 @@ -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 @@ -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 @@ -490,9 +473,6 @@ fn help_flag_subcommand() { --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 @@ -552,9 +532,6 @@ fn help_flag_subsubcommand() { --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 @@ -671,9 +648,6 @@ fn help_with_global_option() { --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 @@ -770,9 +744,6 @@ fn test_with_no_pager() { --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 diff --git a/crates/uv/tests/init.rs b/crates/uv/tests/init.rs index 55ebd47308bc..3338c1f9db3f 100644 --- a/crates/uv/tests/init.rs +++ b/crates/uv/tests/init.rs @@ -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` "###); diff --git a/scripts/release.sh b/scripts/release.sh index f5ba61fb6d57..31879f0a817a 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -11,14 +11,14 @@ echo "Updating metadata with rooster..." cd "$project_root" # Update the preview changelog -uv tool run --from 'rooster-blue>=0.0.7' --python 3.12 --isolated -- \ +uv tool run --from 'rooster-blue>=0.0.7' --python 3.12 -- \ rooster release "$@" \ --only-sections preview \ --changelog-file PREVIEW-CHANGELOG.md \ --no-update-pyproject --no-update-version-files # Update the real changelog -uv tool run --from 'rooster-blue>=0.0.7' --python 3.12 --isolated -- \ +uv tool run --from 'rooster-blue>=0.0.7' --python 3.12 -- \ rooster release "$@" --without-sections preview echo "Updating lockfile..."