@@ -220,7 +220,7 @@ pub fn as_uv_req(
220220 . iter ( )
221221 . map ( |e| uv_normalize:: ExtraName :: from_str ( e. as_ref ( ) ) . expect ( "conversion failed" ) )
222222 . collect ( ) ,
223- marker : to_uv_marker_tree ( & req. env_markers ( ) . clone ( ) ) . expect ( "marker conversion failed" ) ,
223+ marker : to_uv_marker_tree ( req. env_markers ( ) ) . expect ( "marker conversion failed" ) ,
224224 groups : Default :: default ( ) ,
225225 source,
226226 origin : None ,
@@ -309,10 +309,47 @@ pub fn pep508_requirement_to_uv_requirement(
309309
310310#[ cfg( test) ]
311311mod tests {
312+ use pep508_rs:: MarkerTree ;
312313 use uv_redacted:: DisplaySafeUrl ;
313314
314315 use super :: * ;
315316
317+ #[ test]
318+ fn test_markers ( ) {
319+ let pypi_req = PixiPypiSpec :: with_extras_and_markers (
320+ PixiPypiSource :: Registry {
321+ version : VersionOrStar :: Star ,
322+ index : None ,
323+ } ,
324+ vec ! [ ] ,
325+ MarkerTree :: from_str ( "sys_platform == 'linux'" ) . unwrap ( ) ,
326+ ) ;
327+ let uv_req = as_uv_req ( & pypi_req, "test" , Path :: new ( "" ) ) . unwrap ( ) ;
328+
329+ let expected_uv_source = RequirementSource :: Registry {
330+ specifier : VersionSpecifiers :: empty ( ) ,
331+ index : None ,
332+ conflict : None ,
333+ } ;
334+
335+ assert_eq ! (
336+ uv_req. source, expected_uv_source,
337+ "Expected {} but got {}" ,
338+ expected_uv_source, uv_req. source
339+ ) ;
340+
341+ let expected_uv_markers =
342+ uv_pep508:: MarkerTree :: from_str ( "sys_platform == 'linux'" ) . unwrap ( ) ;
343+
344+ assert_eq ! (
345+ uv_req. marker,
346+ expected_uv_markers,
347+ "Expected {:?} but got {:?}" ,
348+ expected_uv_markers. try_to_string( ) ,
349+ uv_req. marker. try_to_string( ) ,
350+ ) ;
351+ }
352+
316353 #[ test]
317354 fn test_git_url ( ) {
318355 let pypi_req = PixiPypiSpec :: new ( PixiPypiSource :: Git {
0 commit comments