• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1"""The input file for the python rule test"""
2
3def exercise_the_api():
4    var1 = PyRuntimeInfo  # @unused
5    var2 = PyInfo  # @unused
6
7exercise_the_api()
8
9def my_rule_impl(ctx):
10    _ignore = [ctx]  # @unused
11    return []
12
13# buildifier: disable=unsorted-dict-items
14py_related_rule = rule(
15    implementation = my_rule_impl,
16    doc = "This rule does python-related things.",
17    attrs = {
18        "first": attr.label(
19            mandatory = True,
20            doc = "this is the first doc string!",
21            allow_single_file = True,
22        ),
23        "second": attr.string_dict(mandatory = True),
24        "third": attr.output(mandatory = True),
25        "fourth": attr.bool(default = False, doc = "the fourth doc string.", mandatory = False),
26        "fifth": attr.bool(default = True, doc = "Hey look, its the fifth thing!"),
27        "sixth": attr.int_list(
28            default = range(10),
29            doc = "it's the sixth thing.",
30            mandatory = False,
31        ),
32        "_hidden": attr.string(),
33    },
34)
35