aboutsummaryrefslogtreecommitdiff
path: root/tools/interface_generator/bin/BUILD.bazel
blob: c593b938bdb7f6f4b614a1758836b92e34bcef06 (plain)
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
47
48
49
50
51
52
53
54
55
56
57
load("@pip//:requirements.bzl", "requirement")
load("//private:defs.bzl", "py_pytest")

""" interface definition """

py_library(
    name = "interface_definition",
    srcs = ["interface_definition.py"],
)

""" templates """

py_library(
    name = "templates",
    srcs = ["templates.py"],
    data = glob(["templates/*"]),
)

py_test(
    name = "templates_unittest",
    srcs = ["templates_unittest.py"],
    imports = ["."],
    deps = [":templates"],
)

""" interface_generator """

py_binary(
    name = "interface_generator",
    srcs = [
        "interface_generator.py",
        "templates.py",
    ],
    data = ["//:LICENSE.md"],
    imports = ["."],
    visibility = ["//visibility:public"],
    deps = [
        ":interface_definition",
        ":templates",
        requirement("mako"),
    ],
)

""" pytest """

py_pytest(
    name = "pytest",
    srcs = [
        "interface_definition.py",
        "interface_generator.py",
        "templates.py",
    ],
    deps = [
        ":interface_generator",
        requirement("mako"),
    ],
)