Skip to content
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
21 changes: 20 additions & 1 deletion crates/uv-python/src/version_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,26 @@ impl PythonVersionFile {
working_directory: impl AsRef<Path>,
options: &DiscoveryOptions<'_>,
) -> Result<Option<Self>, std::io::Error> {
let Some(path) = Self::find_nearest(working_directory, options) else {
let Some(path) = Self::find_nearest(&working_directory, options) else {
if let Some(stop_discovery_at) = options.stop_discovery_at {
if stop_discovery_at == working_directory.as_ref() {
debug!(
"No Python version file found in workspace: {}",
working_directory.as_ref().display()
);
} else {
debug!(
"No Python version file found between working directory `{}` and workspace root `{}`",
working_directory.as_ref().display(),
stop_discovery_at.display()
);
}
} else {
debug!(
"No Python version file found in ancestors of working directory: {}",
working_directory.as_ref().display()
);
}
// Not found in directory or its ancestors. Looking in user-level config.
return Ok(match user_uv_config_dir() {
Some(user_dir) => Self::discover_user_config(user_dir, options)
Expand Down
1 change: 1 addition & 0 deletions crates/uv/tests/it/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15745,6 +15745,7 @@ fn lock_explicit_default_index() -> Result<()> {
DEBUG uv [VERSION] ([COMMIT] DATE)
DEBUG Found workspace root: `[TEMP_DIR]/`
DEBUG Adding root workspace member: `[TEMP_DIR]/`
DEBUG No Python version file found in workspace: [TEMP_DIR]/
DEBUG Using Python request `>=3.12` from `requires-python` metadata
DEBUG Checking for Python environment at `.venv`
DEBUG The virtual environment's Python version satisfies `>=3.12`
Expand Down
Loading