Skip to content

Commit 1e02b28

Browse files
committed
Ignore .python-version files in uv venv with --no-config (#6373)
1 parent 2ca5bb4 commit 1e02b28

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

crates/uv/src/commands/venv.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ pub(crate) async fn venv(
5757
exclude_newer: Option<ExcludeNewer>,
5858
concurrency: Concurrency,
5959
native_tls: bool,
60+
no_config: bool,
6061
cache: &Cache,
6162
printer: Printer,
6263
relocatable: bool,
@@ -78,6 +79,7 @@ pub(crate) async fn venv(
7879
exclude_newer,
7980
concurrency,
8081
native_tls,
82+
no_config,
8183
cache,
8284
printer,
8385
relocatable,
@@ -130,6 +132,7 @@ async fn venv_impl(
130132
exclude_newer: Option<ExcludeNewer>,
131133
concurrency: Concurrency,
132134
native_tls: bool,
135+
no_config: bool,
133136
cache: &Cache,
134137
printer: Printer,
135138
relocatable: bool,
@@ -145,8 +148,7 @@ async fn venv_impl(
145148

146149
// (2) Request from `.python-version`
147150
if interpreter_request.is_none() {
148-
// TODO(zanieb): Support `--no-config` here
149-
interpreter_request = PythonVersionFile::discover(&*CWD, false, false)
151+
interpreter_request = PythonVersionFile::discover(&*CWD, no_config, false)
150152
.await
151153
.into_diagnostic()?
152154
.and_then(PythonVersionFile::into_version);

crates/uv/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,7 @@ async fn run(cli: Cli) -> Result<ExitStatus> {
681681
args.settings.exclude_newer,
682682
globals.concurrency,
683683
globals.native_tls,
684+
cli.no_config,
684685
&cache,
685686
printer,
686687
args.relocatable,

0 commit comments

Comments
 (0)