File: pyproto_test_wrapper.bzl

package info (click to toggle)
protobuf 3.25.4-4
  • links: PTS
  • area: main
  • in suites: experimental
  • size: 45,992 kB
  • sloc: cpp: 204,199; java: 87,622; ansic: 81,204; objc: 58,434; cs: 27,303; python: 22,799; php: 11,340; ruby: 8,637; pascal: 3,324; xml: 2,333; sh: 1,331; makefile: 538; lisp: 86; awk: 17
file content (46 lines) | stat: -rw-r--r-- 1,312 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# begin:github_only

def pyproto_test_wrapper(name, deps = []):
    src = name + "_wrapper.py"
    native.py_test(
        name = name,
        srcs = [src],
        legacy_create_init = False,
        main = src,
        data = ["//src/google/protobuf:testdata"],
        deps = [
            "//python:_message",
            "//:python_common_test_protos",
            "//:python_specific_test_protos",
            "//:python_test_srcs",
            "//:python_srcs",
        ] + deps,
        target_compatible_with = select({
            "@system_python//:supported": [],
            "//conditions:default": ["@platforms//:incompatible"],
        }),
    )

# end:github_only

# begin:google_only
#
# load("//third_party/bazel_rules/rules_python/python:py_test.bzl", "py_test")
#
# def pyproto_test_wrapper(name):
#     src = name + "_wrapper.py"
#     py_test(
#         name = name,
#         srcs = [src],
#         main = src,
#         deps = [
#             "//third_party/py/google/protobuf/internal:" + name + "_for_deps",
#             "//third_party/py/google/protobuf:use_upb_protos",
#         ],
#         target_compatible_with = select({
#             "@platforms//os:windows": ["@platforms//:incompatible"],
#             "//conditions:default": [],
#         }),
#     )
#
# end:google_only