blob: 2ee9b757bb0cd8d80025b8e04b27642daf05e869 [file] [log] [blame]
Greg Estren2323dfe2020-07-15 12:02:51 -07001# Description:
2# Tool for measuring how configuration transitions affect build graph size.
3load("//tools/python:private/defs.bzl", "py_binary", "py_library")
4
5package(default_visibility = ["//visibility:public"])
6
7licenses(["notice"]) # Apache 2.0
8
Greg Estrenc1d70872020-08-25 07:17:08 -07009filegroup(
10 name = "srcs",
11 srcs = glob(["**"]),
12)
13
Greg Estren2323dfe2020-07-15 12:02:51 -070014py_binary(
15 name = "ctexplain",
16 srcs = ["ctexplain.py"],
17 python_version = "PY3",
Greg Estrenc1d70872020-08-25 07:17:08 -070018 deps = [
19 ":analyses",
20 ":base",
21 ":bazel_api",
22 ":lib",
23 "//third_party/py/abseil",
24 ],
25)
26
27py_library(
28 name = "lib",
29 srcs = ["lib.py"],
30 srcs_version = "PY3ONLY",
31 deps = [
32 ":base",
33 ":bazel_api",
34 ],
Greg Estren2323dfe2020-07-15 12:02:51 -070035)
36
37py_library(
38 name = "bazel_api",
39 srcs = ["bazel_api.py"],
40 srcs_version = "PY3ONLY",
41 deps = [":base"],
42)
43
Greg Estrenc1d70872020-08-25 07:17:08 -070044py_library(
45 name = "analyses",
46 srcs = ["analyses/summary.py"],
47 srcs_version = "PY3ONLY",
48 deps = [":base"],
49)
50
51py_library(
52 name = "base",
53 srcs = [
54 "types.py",
55 "util.py",
56 ],
57 srcs_version = "PY3ONLY",
58 deps = [
59 "//third_party/py/dataclasses", # Backport for Python < 3.7.
60 "//third_party/py/frozendict",
61 ],
62)
63
64py_test(
65 name = "lib_test",
66 size = "small",
67 srcs = ["lib_test.py"],
68 python_version = "PY3",
69 deps = [
70 ":bazel_api",
71 ":lib",
72 "//src/test/py/bazel:test_base",
73 ],
74)
75
Greg Estren2323dfe2020-07-15 12:02:51 -070076py_test(
77 name = "bazel_api_test",
78 size = "small",
79 srcs = ["bazel_api_test.py"],
80 python_version = "PY3",
81 deps = [
82 ":bazel_api",
83 "//src/test/py/bazel:test_base",
84 ],
85)
86
Greg Estrenc1d70872020-08-25 07:17:08 -070087py_test(
88 name = "analyses_test",
89 size = "small",
90 srcs = ["analyses/summary_test.py"],
91 main = "analyses/summary_test.py", # TODO: generalize this.
92 python_version = "PY3",
Greg Estren2323dfe2020-07-15 12:02:51 -070093 deps = [
Greg Estrenc1d70872020-08-25 07:17:08 -070094 ":analyses",
95 ":base",
Greg Estren2323dfe2020-07-15 12:02:51 -070096 ],
97)
98
99py_test(
100 name = "types_test",
101 size = "small",
102 srcs = ["types_test.py"],
103 python_version = "PY3",
104 deps = [
105 ":base",
106 "//third_party/py/frozendict",
107 ],
108)