mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-19 03:05:06 +00:00
Ignore arbitrary Python requests in version files (#12909)
Closes https://github.com/astral-sh/uv/issues/12605
This commit is contained in:
parent
1988e209ef
commit
6cc2202799
3 changed files with 92 additions and 0 deletions
|
@ -6,6 +6,7 @@ use itertools::Itertools;
|
|||
use tracing::debug;
|
||||
use uv_dirs::user_uv_config_dir;
|
||||
use uv_fs::Simplified;
|
||||
use uv_warnings::warn_user_once;
|
||||
|
||||
use crate::PythonRequest;
|
||||
|
||||
|
@ -171,6 +172,17 @@ impl PythonVersionFile {
|
|||
})
|
||||
.map(ToString::to_string)
|
||||
.map(|version| PythonRequest::parse(&version))
|
||||
.filter(|request| {
|
||||
if let PythonRequest::ExecutableName(name) = request {
|
||||
warn_user_once!(
|
||||
"Ignoring unsupported Python request `{name}` in version file: {}",
|
||||
path.display()
|
||||
);
|
||||
false
|
||||
} else {
|
||||
true
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
Ok(Some(Self { path, versions }))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue