File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -505,9 +505,9 @@ def _py_wheel_impl(ctx):
505505
506506 for target , filename in ctx .attr .data_files .items ():
507507 target_files = target [DefaultInfo ].files .to_list ()
508- if len (target_files ) != 1 :
508+ if len (target_files ) != 1 and not filename . endswith ( "/" ) :
509509 fail (
510- "Multi-file target listed in data_files %s" ,
510+ "Multi-file target listed in data_files %s, this is only supported when specifying a folder path (i.e. a path ending in '/') " ,
511511 filename ,
512512 )
513513
@@ -520,13 +520,14 @@ def _py_wheel_impl(ctx):
520520 ),
521521 )
522522
523- final_filename = filename + target_files [0 ].basename if filename .endswith ("/" ) else filename
523+ for file in target_files :
524+ final_filename = filename + file .basename if filename .endswith ("/" ) else filename
524525
525- other_inputs .extend (target_files )
526- args .add (
527- "--data_files" ,
528- final_filename + ";" + target_files [ 0 ] .path ,
529- )
526+ other_inputs .extend (target_files )
527+ args .add (
528+ "--data_files" ,
529+ final_filename + ";" + file .path ,
530+ )
530531
531532 ctx .actions .run (
532533 mnemonic = "PyWheel" ,
You can’t perform that action at this time.
0 commit comments