Skip to content

Commit

Permalink
feat: Add support for python-wheel data directory
Browse files Browse the repository at this point in the history
This feature addes  attribute to the py_wheel rule and
makes a related change to the wheelmaker tool.

Fixes bazelbuild#1777
  • Loading branch information
BradHolmes committed Mar 12, 2024
1 parent 37455a1 commit 225e531
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/py_wheel/py_wheel_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,32 @@ def _test_metadata_impl(env, target):

_tests.append(_test_metadata)

def _test_data(name):
rt_util.helper_target(
py_wheel,
name = name + "_data",
distribution = "mydist_" + name,
version = "0.0.0",
data_files = {
"source_name": "wheel_name",
},
)
analysis_test(
name = name,
impl = _test_data_impl,
target = name + "_data",
)

def _test_data_impl(env, target):

action = env.expect.that_target(target).action_named(
"PyWheel",
)
action.contains_at_least_args(["--data_files", "wheel_name;tests/py_wheel/source_name"])
action.contains_at_least_inputs(["tests/py_wheel/source_name"])

_tests.append(_test_data)

def _test_content_type_from_attr(name):
rt_util.helper_target(
py_wheel,
Expand Down

0 comments on commit 225e531

Please sign in to comment.