Skip to content

Commit 84ec18d

Browse files
committed
Partial fix for failing test.
1 parent 2bb2372 commit 84ec18d

File tree

3 files changed

+13
-17
lines changed

3 files changed

+13
-17
lines changed

crates/pixi_cli/src/upgrade.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use fancy_display::FancyDisplay;
55
use indexmap::{IndexMap, IndexSet};
66
use itertools::Itertools;
77
use miette::{IntoDiagnostic, MietteDiagnostic, WrapErr};
8-
use pep508_rs::{MarkerTree, Requirement};
8+
use pep508_rs::Requirement;
99
use pixi_config::ConfigCli;
1010
use pixi_core::{
1111
WorkspaceLocator,
@@ -473,8 +473,7 @@ pub fn parse_specs_for_platform(
473473
Requirement {
474474
name: name.as_normalized().clone(),
475475
extras: req.extras.clone(),
476-
// TODO: Add marker support here to avoid overwriting existing markers
477-
marker: MarkerTree::default(),
476+
marker: req.env_markers.clone(),
478477
origin: None,
479478
version_or_url: None,
480479
},

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -347,15 +347,6 @@ pub async fn resolve_pypi(
347347
tracing::info!("there are no python packages installed by conda");
348348
}
349349

350-
let mut requirements = dependencies
351-
.into_iter()
352-
.flat_map(|(name, req)| {
353-
req.into_iter()
354-
.map(move |r| as_uv_req(&r, name.as_ref(), project_root))
355-
})
356-
.collect::<Result<Vec<_>, _>>()
357-
.into_diagnostic()?;
358-
359350
// Determine the python interpreter that is installed as part of the conda
360351
// packages.
361352
let python_record = locked_pixi_records
@@ -371,6 +362,16 @@ pub async fn resolve_pypi(
371362
// Construct the marker environment for the target platform
372363
let marker_environment = determine_marker_environment(platform, python_record.as_ref())?;
373364

365+
let mut requirements = dependencies
366+
.into_iter()
367+
.flat_map(|(name, req)| {
368+
req.into_iter()
369+
.map(move |r| as_uv_req(&r, name.as_ref(), project_root))
370+
})
371+
.filter_ok(|uv_req| uv_req.evaluate_markers(Some(&marker_environment), &uv_req.extras))
372+
.collect::<Result<Vec<_>, _>>()
373+
.into_diagnostic()?;
374+
374375
// Determine the tags for this particular solve.
375376
let tags = get_pypi_tags(platform, &system_requirements, python_record.as_ref())?;
376377

crates/pixi_pypi_spec/src/lib.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,7 @@ impl From<PixiPypiSource> for PixiPypiSpec {
207207
impl PixiPypiSpec {
208208
/// Creates a new spec with the given source and no extras.
209209
pub fn new(source: PixiPypiSource) -> Self {
210-
PixiPypiSpec {
211-
extras: Vec::new(),
212-
source,
213-
env_markers: MarkerTree::default(),
214-
}
210+
source.into()
215211
}
216212

217213
/// Creates a new spec with the given source and extras.

0 commit comments

Comments
 (0)