From 01fc233dd060cc9148f55b3666ee815a58525eaa Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Fri, 23 Aug 2024 08:56:11 -0500 Subject: [PATCH] Ignore `.python-version` files in `uv venv` with `--no-config` (#6513) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dupe of #6373 — merged into the wrong branch by accident. --- crates/uv/src/commands/venv.rs | 6 ++++-- crates/uv/src/lib.rs | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/uv/src/commands/venv.rs b/crates/uv/src/commands/venv.rs index 7aa395649..25772e3e1 100644 --- a/crates/uv/src/commands/venv.rs +++ b/crates/uv/src/commands/venv.rs @@ -57,6 +57,7 @@ pub(crate) async fn venv( exclude_newer: Option, concurrency: Concurrency, native_tls: bool, + no_config: bool, cache: &Cache, printer: Printer, relocatable: bool, @@ -78,6 +79,7 @@ pub(crate) async fn venv( exclude_newer, concurrency, native_tls, + no_config, cache, printer, relocatable, @@ -130,6 +132,7 @@ async fn venv_impl( exclude_newer: Option, concurrency: Concurrency, native_tls: bool, + no_config: bool, cache: &Cache, printer: Printer, relocatable: bool, @@ -145,8 +148,7 @@ async fn venv_impl( // (2) Request from `.python-version` if interpreter_request.is_none() { - // TODO(zanieb): Support `--no-config` here - interpreter_request = PythonVersionFile::discover(&*CWD, false, false) + interpreter_request = PythonVersionFile::discover(&*CWD, no_config, false) .await .into_diagnostic()? .and_then(PythonVersionFile::into_version); diff --git a/crates/uv/src/lib.rs b/crates/uv/src/lib.rs index 4b63e235b..e707cda9e 100644 --- a/crates/uv/src/lib.rs +++ b/crates/uv/src/lib.rs @@ -681,6 +681,7 @@ async fn run(cli: Cli) -> Result { args.settings.exclude_newer, globals.concurrency, globals.native_tls, + cli.no_config, &cache, printer, args.relocatable,