File tree Expand file tree Collapse file tree 3 files changed +13
-17
lines changed
pixi_core/src/lock_file/resolve Expand file tree Collapse file tree 3 files changed +13
-17
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use fancy_display::FancyDisplay;
55use indexmap:: { IndexMap , IndexSet } ;
66use itertools:: Itertools ;
77use miette:: { IntoDiagnostic , MietteDiagnostic , WrapErr } ;
8- use pep508_rs:: { MarkerTree , Requirement } ;
8+ use pep508_rs:: Requirement ;
99use pixi_config:: ConfigCli ;
1010use 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 } ,
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -207,11 +207,7 @@ impl From<PixiPypiSource> for PixiPypiSpec {
207207impl 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.
You can’t perform that action at this time.
0 commit comments