Skip to content

Commit

Permalink
Pass deps to py_test in py_test_module_list
Browse files Browse the repository at this point in the history
Bazel macro py_test_module_list takes a `deps` argument, but completely
ignores it instead of passes it to `native.py_test`. Fixing that as we
are going to use deps of py_test_module_list in BUILD in later changes.

cpp/BUILD.bazel depends on the broken behaviour: it deps-on a cc_library
from a py_test, which isn't working, see upstream issue:
bazelbuild/bazel#701.
This is fixed by simply removing the (non-working) deps.
  • Loading branch information
Riatre committed Jul 12, 2022
1 parent adfdc26 commit 53fcbc2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion bazel/python.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ load("@bazel_skylib//lib:paths.bzl", "paths")
# py_test_module_list creates a py_test target for each
# Python file in `files`

def py_test_module_list(files, size, deps, extra_srcs, name_suffix="", **kwargs):
def py_test_module_list(files, size, deps, extra_srcs=[], name_suffix="", **kwargs):
for file in files:
# remove .py
name = paths.split_extension(file)[0] + name_suffix
Expand All @@ -14,6 +14,7 @@ def py_test_module_list(files, size, deps, extra_srcs, name_suffix="", **kwargs)
size = size,
main = file,
srcs = extra_srcs + [file],
deps = deps,
**kwargs
)

Expand Down
4 changes: 1 addition & 3 deletions cpp/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,5 @@ py_test_module_list(
"small_size_python_tests",
"team:core",
],
deps = [
":ray_api",
],
deps = [],
)

0 comments on commit 53fcbc2

Please sign in to comment.