@@ -337,6 +337,221 @@ fn requirements_txt_project_extra() -> Result<()> {
337337 Ok ( ( ) )
338338}
339339
340+ #[ test]
341+ fn requirements_txt_project_default_extras ( ) -> Result < ( ) > {
342+ let context = TestContext :: new ( "3.12" ) ;
343+
344+ let pyproject_toml = context. temp_dir . child ( "pyproject.toml" ) ;
345+ pyproject_toml. write_str (
346+ r#"
347+ [project]
348+ name = "project"
349+ version = "0.1.0"
350+ requires-python = ">=3.12"
351+ dependencies = ["typing-extensions"]
352+
353+ [project.optional-dependencies]
354+ async = ["anyio==3.7.0"]
355+ pytest = ["iniconfig"]
356+
357+ [tool.uv]
358+ default-extras = ["async"]
359+
360+ [build-system]
361+ requires = ["setuptools>=42"]
362+ build-backend = "setuptools.build_meta"
363+ "# ,
364+ ) ?;
365+
366+ context. lock ( ) . assert ( ) . success ( ) ;
367+
368+ uv_snapshot ! ( context. filters( ) , context. export( ) , @r"
369+ success: true
370+ exit_code: 0
371+ ----- stdout -----
372+ # This file was autogenerated by uv via the following command:
373+ # uv export --cache-dir [CACHE_DIR]
374+ -e .
375+ anyio==3.7.0 \
376+ --hash=sha256:275d9973793619a5374e1c89a4f4ad3f4b0a5510a2b5b939444bee8f4c4d37ce \
377+ --hash=sha256:eddca883c4175f14df8aedce21054bfca3adb70ffe76a9f607aef9d7fa2ea7f0
378+ # via project
379+ idna==3.6 \
380+ --hash=sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca \
381+ --hash=sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f
382+ # via anyio
383+ sniffio==1.3.1 \
384+ --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 \
385+ --hash=sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc
386+ # via anyio
387+ typing-extensions==4.10.0 \
388+ --hash=sha256:69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475 \
389+ --hash=sha256:b0abd7c89e8fb96f98db18d86106ff1d90ab692004eb746cf6eda2682f91b3cb
390+ # via project
391+
392+ ----- stderr -----
393+ Resolved 6 packages in [TIME]
394+ " ) ;
395+
396+ uv_snapshot ! ( context. filters( ) , context. export( ) . arg( "--extra" ) . arg( "pytest" ) . arg( "--extra" ) . arg( "async" ) . arg( "--no-extra" ) . arg( "pytest" ) , @r###"
397+ success: true
398+ exit_code: 0
399+ ----- stdout -----
400+ # This file was autogenerated by uv via the following command:
401+ # uv export --cache-dir [CACHE_DIR] --extra pytest --extra async --no-extra pytest
402+ -e .
403+ anyio==3.7.0 \
404+ --hash=sha256:275d9973793619a5374e1c89a4f4ad3f4b0a5510a2b5b939444bee8f4c4d37ce \
405+ --hash=sha256:eddca883c4175f14df8aedce21054bfca3adb70ffe76a9f607aef9d7fa2ea7f0
406+ # via project
407+ idna==3.6 \
408+ --hash=sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca \
409+ --hash=sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f
410+ # via anyio
411+ sniffio==1.3.1 \
412+ --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 \
413+ --hash=sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc
414+ # via anyio
415+ typing-extensions==4.10.0 \
416+ --hash=sha256:69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475 \
417+ --hash=sha256:b0abd7c89e8fb96f98db18d86106ff1d90ab692004eb746cf6eda2682f91b3cb
418+ # via project
419+
420+ ----- stderr -----
421+ Resolved 6 packages in [TIME]
422+ "### ) ;
423+
424+ uv_snapshot ! ( context. filters( ) , context. export( ) . arg( "--extra" ) . arg( "pytest" ) , @r"
425+ success: true
426+ exit_code: 0
427+ ----- stdout -----
428+ # This file was autogenerated by uv via the following command:
429+ # uv export --cache-dir [CACHE_DIR] --extra pytest
430+ -e .
431+ anyio==3.7.0 \
432+ --hash=sha256:275d9973793619a5374e1c89a4f4ad3f4b0a5510a2b5b939444bee8f4c4d37ce \
433+ --hash=sha256:eddca883c4175f14df8aedce21054bfca3adb70ffe76a9f607aef9d7fa2ea7f0
434+ # via project
435+ idna==3.6 \
436+ --hash=sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca \
437+ --hash=sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f
438+ # via anyio
439+ iniconfig==2.0.0 \
440+ --hash=sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 \
441+ --hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374
442+ # via project
443+ sniffio==1.3.1 \
444+ --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 \
445+ --hash=sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc
446+ # via anyio
447+ typing-extensions==4.10.0 \
448+ --hash=sha256:69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475 \
449+ --hash=sha256:b0abd7c89e8fb96f98db18d86106ff1d90ab692004eb746cf6eda2682f91b3cb
450+ # via project
451+
452+ ----- stderr -----
453+ Resolved 6 packages in [TIME]
454+ " ) ;
455+
456+ uv_snapshot ! ( context. filters( ) , context. export( ) . arg( "--all-extras" ) , @r###"
457+ success: true
458+ exit_code: 0
459+ ----- stdout -----
460+ # This file was autogenerated by uv via the following command:
461+ # uv export --cache-dir [CACHE_DIR] --all-extras
462+ -e .
463+ anyio==3.7.0 \
464+ --hash=sha256:275d9973793619a5374e1c89a4f4ad3f4b0a5510a2b5b939444bee8f4c4d37ce \
465+ --hash=sha256:eddca883c4175f14df8aedce21054bfca3adb70ffe76a9f607aef9d7fa2ea7f0
466+ # via project
467+ idna==3.6 \
468+ --hash=sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca \
469+ --hash=sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f
470+ # via anyio
471+ iniconfig==2.0.0 \
472+ --hash=sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 \
473+ --hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374
474+ # via project
475+ sniffio==1.3.1 \
476+ --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 \
477+ --hash=sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc
478+ # via anyio
479+ typing-extensions==4.10.0 \
480+ --hash=sha256:69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475 \
481+ --hash=sha256:b0abd7c89e8fb96f98db18d86106ff1d90ab692004eb746cf6eda2682f91b3cb
482+ # via project
483+
484+ ----- stderr -----
485+ Resolved 6 packages in [TIME]
486+ "### ) ;
487+
488+ uv_snapshot ! ( context. filters( ) , context. export( ) . arg( "--all-extras" ) . arg( "--no-extra" ) . arg( "pytest" ) , @r###"
489+ success: true
490+ exit_code: 0
491+ ----- stdout -----
492+ # This file was autogenerated by uv via the following command:
493+ # uv export --cache-dir [CACHE_DIR] --all-extras --no-extra pytest
494+ -e .
495+ anyio==3.7.0 \
496+ --hash=sha256:275d9973793619a5374e1c89a4f4ad3f4b0a5510a2b5b939444bee8f4c4d37ce \
497+ --hash=sha256:eddca883c4175f14df8aedce21054bfca3adb70ffe76a9f607aef9d7fa2ea7f0
498+ # via project
499+ idna==3.6 \
500+ --hash=sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca \
501+ --hash=sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f
502+ # via anyio
503+ sniffio==1.3.1 \
504+ --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 \
505+ --hash=sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc
506+ # via anyio
507+ typing-extensions==4.10.0 \
508+ --hash=sha256:69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475 \
509+ --hash=sha256:b0abd7c89e8fb96f98db18d86106ff1d90ab692004eb746cf6eda2682f91b3cb
510+ # via project
511+
512+ ----- stderr -----
513+ Resolved 6 packages in [TIME]
514+ "### ) ;
515+
516+ uv_snapshot ! ( context. filters( ) , context. export( ) . arg( "--no-default-extras" ) , @r"
517+ success: true
518+ exit_code: 0
519+ ----- stdout -----
520+ # This file was autogenerated by uv via the following command:
521+ # uv export --cache-dir [CACHE_DIR] --no-default-extras
522+ -e .
523+ typing-extensions==4.10.0 \
524+ --hash=sha256:69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475 \
525+ --hash=sha256:b0abd7c89e8fb96f98db18d86106ff1d90ab692004eb746cf6eda2682f91b3cb
526+ # via project
527+
528+ ----- stderr -----
529+ Resolved 6 packages in [TIME]
530+ " ) ;
531+
532+ uv_snapshot ! ( context. filters( ) , context. export( ) . arg( "--no-default-extras" ) . arg( "--only-extra" ) . arg( "pytest" ) , @r"
533+ success: true
534+ exit_code: 0
535+ ----- stdout -----
536+ # This file was autogenerated by uv via the following command:
537+ # uv export --cache-dir [CACHE_DIR] --no-default-extras --only-extra pytest
538+ -e .
539+ iniconfig==2.0.0 \
540+ --hash=sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 \
541+ --hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374
542+ # via project
543+ typing-extensions==4.10.0 \
544+ --hash=sha256:69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475 \
545+ --hash=sha256:b0abd7c89e8fb96f98db18d86106ff1d90ab692004eb746cf6eda2682f91b3cb
546+ # via project
547+
548+ ----- stderr -----
549+ Resolved 6 packages in [TIME]
550+ " ) ;
551+
552+ Ok ( ( ) )
553+ }
554+
340555#[ test]
341556fn requirements_txt_prune ( ) -> Result < ( ) > {
342557 let context = TestContext :: new ( "3.12" ) ;
0 commit comments