@@ -102,35 +102,36 @@ pub fn write_python_part(
102102 python_packages. push ( package_path) ;
103103 }
104104
105- for package in python_packages {
106- for absolute in WalkBuilder :: new ( & project_layout. project_root )
107- . hidden ( false )
108- . parents ( false )
109- . git_global ( false )
110- . git_exclude ( false )
111- . build ( )
105+ for absolute in WalkBuilder :: new ( & project_layout. project_root )
106+ . hidden ( false )
107+ . parents ( false )
108+ . git_global ( false )
109+ . git_exclude ( false )
110+ . build ( )
111+ {
112+ let absolute = absolute?. into_path ( ) ;
113+ if !python_packages
114+ . iter ( )
115+ . any ( |path| absolute. starts_with ( path) )
112116 {
113- let absolute = absolute?. into_path ( ) ;
114- if !absolute. starts_with ( package. as_path ( ) ) {
115- continue ;
116- }
117- let relative = absolute. strip_prefix ( python_dir) . unwrap ( ) ;
118- if !absolute. is_dir ( ) {
119- // Ignore native libraries from develop, if any
120- if let Some ( extension) = relative. extension ( ) {
121- if extension. to_string_lossy ( ) == "so" {
122- debug ! ( "Ignoring native library {}" , relative. display( ) ) ;
123- continue ;
124- }
117+ continue ;
118+ }
119+ let relative = absolute. strip_prefix ( python_dir) . unwrap ( ) ;
120+ if !absolute. is_dir ( ) {
121+ // Ignore native libraries from develop, if any
122+ if let Some ( extension) = relative. extension ( ) {
123+ if extension. to_string_lossy ( ) == "so" {
124+ debug ! ( "Ignoring native library {}" , relative. display( ) ) ;
125+ continue ;
125126 }
126- #[ cfg( unix) ]
127- let mode = absolute. metadata ( ) ?. permissions ( ) . mode ( ) ;
128- #[ cfg( not( unix) ) ]
129- let mode = 0o644 ;
130- writer
131- . add_file_with_permissions ( relative, & absolute, mode)
132- . context ( format ! ( "File to add file from {}" , absolute. display( ) ) ) ?;
133127 }
128+ #[ cfg( unix) ]
129+ let mode = absolute. metadata ( ) ?. permissions ( ) . mode ( ) ;
130+ #[ cfg( not( unix) ) ]
131+ let mode = 0o644 ;
132+ writer
133+ . add_file_with_permissions ( relative, & absolute, mode)
134+ . context ( format ! ( "File to add file from {}" , absolute. display( ) ) ) ?;
134135 }
135136 }
136137
0 commit comments