Skip to content

Commit f61b4cf

Browse files
committed
Allow files in wheels to be installed to directories
When specifying `data_files` in `py_wheel`, allow just the directory to be specified (with a trailing slash), in which case it will use the file's name. This avoids duplicating (potentially platform-specific) names.
1 parent 1f6cc5c commit f61b4cf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

python/private/py_wheel.bzl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,10 +519,13 @@ def _py_wheel_impl(ctx):
519519
filename,
520520
),
521521
)
522+
523+
final_filename = filename + target_files[0].basename if filename.endswith("/") else filename
524+
522525
other_inputs.extend(target_files)
523526
args.add(
524527
"--data_files",
525-
filename + ";" + target_files[0].path,
528+
final_filename + ";" + target_files[0].path,
526529
)
527530

528531
ctx.actions.run(

0 commit comments

Comments
 (0)