@@ -3969,6 +3969,47 @@ fn no_deps_invalid_extra() -> Result<()> {
3969
3969
Ok ( ( ) )
3970
3970
}
3971
3971
3972
+ /// Resolve an editable package with an invalid extra.
3973
+ #[ test]
3974
+ fn editable_invalid_extra ( ) -> Result < ( ) > {
3975
+ let context = TestContext :: new ( "3.12" ) ;
3976
+ let requirements_in = context. temp_dir . child ( "requirements.in" ) ;
3977
+ requirements_in. write_str ( "-e ../../scripts/editable-installs/black_editable[empty]" ) ?;
3978
+
3979
+ let requirements_path = regex:: escape ( & requirements_in. normalized_display ( ) . to_string ( ) ) ;
3980
+ let filters: Vec < _ > = [
3981
+ ( r" file://.*/" , " file://[TEMP_DIR]/" ) ,
3982
+ ( requirements_path. as_str ( ) , "requirements.in" ) ,
3983
+ ]
3984
+ . into_iter ( )
3985
+ . chain ( INSTA_FILTERS . to_vec ( ) )
3986
+ . collect ( ) ;
3987
+
3988
+ uv_snapshot ! ( filters, Command :: new( get_bin( ) )
3989
+ . arg( "pip" )
3990
+ . arg( "compile" )
3991
+ . arg( requirements_in. path( ) )
3992
+ . arg( "--cache-dir" )
3993
+ . arg( context. cache_dir. path( ) )
3994
+ . arg( "--exclude-newer" )
3995
+ . arg( EXCLUDE_NEWER )
3996
+ . env( "VIRTUAL_ENV" , context. venv. as_os_str( ) ) , @r###"
3997
+ success: true
3998
+ exit_code: 0
3999
+ ----- stdout -----
4000
+ # This file was autogenerated by uv via the following command:
4001
+ # uv pip compile requirements.in --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z
4002
+ -e ../../scripts/editable-installs/black_editable
4003
+
4004
+ ----- stderr -----
4005
+ Built 1 editable in [TIME]
4006
+ Resolved 1 package in [TIME]
4007
+ warning: The package `black @ file://[TEMP_DIR]/black_editable` does not have an extra named `empty`.
4008
+ "### ) ;
4009
+
4010
+ Ok ( ( ) )
4011
+ }
4012
+
3972
4013
/// Resolve a package from a `requirements.in` file, with a `constraints.txt` file pinning one of
3973
4014
/// its transitive dependencies to a specific version.
3974
4015
#[ test]
0 commit comments