Account for python_downloads_json_url on Pre-release Python version warnings (#16737)

Solves #16711
This commit is contained in:
Meitar Reihan 2025-11-14 23:12:35 +02:00 committed by GitHub
parent 4e4235648a
commit 7f4d8c67a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 62 additions and 8 deletions

View file

@ -59,12 +59,13 @@ impl PythonInstallation {
request: &PythonRequest,
environments: EnvironmentPreference,
preference: PythonPreference,
python_downloads_json_url: Option<&str>,
cache: &Cache,
preview: Preview,
) -> Result<Self, Error> {
let installation =
find_python_installation(request, environments, preference, cache, preview)??;
installation.warn_if_outdated_prerelease(request, None);
installation.warn_if_outdated_prerelease(request, python_downloads_json_url);
Ok(installation)
}
@ -74,12 +75,13 @@ impl PythonInstallation {
request: &PythonRequest,
environments: EnvironmentPreference,
preference: PythonPreference,
python_downloads_json_url: Option<&str>,
cache: &Cache,
preview: Preview,
) -> Result<Self, Error> {
let installation =
find_best_python_installation(request, environments, preference, cache, preview)??;
installation.warn_if_outdated_prerelease(request, None);
installation.warn_if_outdated_prerelease(request, python_downloads_json_url);
Ok(installation)
}
@ -102,7 +104,14 @@ impl PythonInstallation {
let request = request.unwrap_or(&PythonRequest::Default);
// Search for the installation
let err = match Self::find(request, environments, preference, cache, preview) {
let err = match Self::find(
request,
environments,
preference,
python_downloads_json_url,
cache,
preview,
) {
Ok(installation) => return Ok(installation),
Err(err) => err,
};