From 4587fc220a32f2467ee0b04f670863396e2165cb Mon Sep 17 00:00:00 2001 From: Riatre Foo Date: Sat, 9 Jul 2022 16:07:57 +0800 Subject: [PATCH] Pass deps to py_test in py_test_module_list 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: https://github.com/bazelbuild/bazel/issues/701. This is fixed by simply removing the (non-working) deps. --- bazel/python.bzl | 3 ++- cpp/BUILD.bazel | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/bazel/python.bzl b/bazel/python.bzl index 725da8d205254a..b6354442385d8d 100644 --- a/bazel/python.bzl +++ b/bazel/python.bzl @@ -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 @@ -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 ) diff --git a/cpp/BUILD.bazel b/cpp/BUILD.bazel index 09b5bc5a04877c..14d170c2361808 100644 --- a/cpp/BUILD.bazel +++ b/cpp/BUILD.bazel @@ -321,7 +321,5 @@ py_test_module_list( "small_size_python_tests", "team:core", ], - deps = [ - ":ray_api", - ], + deps = [], )