Skip to content

Commit c49695e

Browse files
authored
fix: don't misclassify missing python as pypi-only during upgrade (#6095)
1 parent e497300 commit c49695e

1 file changed

Lines changed: 5 additions & 15 deletions

File tree

  • crates/pixi_core/src/lock_file/satisfiability

crates/pixi_core/src/lock_file/satisfiability/pypi.rs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -440,14 +440,7 @@ pub(super) async fn lock_pypi_packages(
440440

441441
read_local_package_metadata(&absolute_path, pkg.name(), &build_ctx)
442442
.await
443-
.map_err(|e| {
444-
CommandDispatcherError::Failed(Box::new(
445-
PlatformUnsat::FailedToReadLocalMetadata(
446-
pkg.name().clone(),
447-
format!("failed to read metadata: {e}"),
448-
),
449-
))
450-
})?
443+
.map_err(|e| CommandDispatcherError::Failed(Box::new(e)))?
451444
} else {
452445
None
453446
}
@@ -508,18 +501,15 @@ async fn read_local_package_metadata(
508501

509502
let pypi_options = ctx.environment.pypi_options();
510503

511-
// Find the Python interpreter from locked records
504+
// Missing python is a conda-side gap (e.g. `unlock_packages` stripped
505+
// it pre-resolve); raise the non-pypi-only variant so the env is
506+
// marked `outdated_conda`. #6093.
512507
let python_record = ctx
513508
.locked_pixi_records
514509
.records
515510
.iter()
516511
.find(|r| is_python_record(r))
517-
.ok_or_else(|| {
518-
PlatformUnsat::FailedToReadLocalMetadata(
519-
package_name.clone(),
520-
"No Python interpreter found in locked packages".to_string(),
521-
)
522-
})?;
512+
.ok_or(PlatformUnsat::MissingPythonInterpreter)?;
523513

524514
// Create marker environment for the target platform
525515
let marker_environment = determine_marker_environment(ctx.platform, python_record.as_ref())

0 commit comments

Comments
 (0)