1# Copyright 2022 The Pigweed Authors 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); you may not 4# use this file except in compliance with the License. You may obtain a copy of 5# the License at 6# 7# https://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12# License for the specific language governing permissions and limitations under 13# the License. 14 15load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test") 16 17package(default_visibility = ["//visibility:public"]) 18 19py_library( 20 name = "event_count_history", 21 srcs = ["pw_console/widgets/event_count_history.py"], 22) 23 24py_library( 25 name = "pyserial_wrapper", 26 srcs = ["pw_console/pyserial_wrapper.py"], 27 deps = [ 28 ":event_count_history", 29 ], 30) 31 32py_library( 33 name = "pw_console", 34 srcs = [ 35 "pw_console/__init__.py", 36 "pw_console/__main__.py", 37 "pw_console/command_runner.py", 38 "pw_console/console_app.py", 39 "pw_console/console_log_server.py", 40 "pw_console/console_prefs.py", 41 "pw_console/docs/__init__.py", 42 "pw_console/embed.py", 43 "pw_console/filter_toolbar.py", 44 "pw_console/get_pw_console_app.py", 45 "pw_console/help_window.py", 46 "pw_console/html/__init__.py", 47 "pw_console/key_bindings.py", 48 "pw_console/log_filter.py", 49 "pw_console/log_line.py", 50 "pw_console/log_pane.py", 51 "pw_console/log_pane_saveas_dialog.py", 52 "pw_console/log_pane_selection_dialog.py", 53 "pw_console/log_pane_toolbars.py", 54 "pw_console/log_screen.py", 55 "pw_console/log_store.py", 56 "pw_console/log_view.py", 57 "pw_console/mouse.py", 58 "pw_console/pigweed_code_style.py", 59 "pw_console/plugin_mixin.py", 60 "pw_console/plugins/__init__.py", 61 "pw_console/plugins/bandwidth_toolbar.py", 62 "pw_console/plugins/calc_pane.py", 63 "pw_console/plugins/clock_pane.py", 64 "pw_console/plugins/twenty48_pane.py", 65 "pw_console/progress_bar/__init__.py", 66 "pw_console/progress_bar/progress_bar_impl.py", 67 "pw_console/progress_bar/progress_bar_state.py", 68 "pw_console/progress_bar/progress_bar_task_counter.py", 69 "pw_console/pw_ptpython_repl.py", 70 "pw_console/python_logging.py", 71 "pw_console/quit_dialog.py", 72 "pw_console/repl_pane.py", 73 "pw_console/search_toolbar.py", 74 "pw_console/socket_client.py", 75 "pw_console/style.py", 76 "pw_console/templates/__init__.py", 77 "pw_console/test_mode.py", 78 "pw_console/text_formatting.py", 79 "pw_console/widgets/__init__.py", 80 "pw_console/widgets/border.py", 81 "pw_console/widgets/checkbox.py", 82 "pw_console/widgets/mouse_handlers.py", 83 "pw_console/widgets/table.py", 84 "pw_console/widgets/window_pane.py", 85 "pw_console/widgets/window_pane_toolbar.py", 86 "pw_console/window_list.py", 87 "pw_console/window_manager.py", 88 ], 89 data = [ 90 "pw_console/docs/user_guide.rst", 91 "pw_console/html/index.html", 92 "pw_console/html/main.js", 93 "pw_console/html/style.css", 94 "pw_console/py.typed", 95 "pw_console/templates/keybind_list.jinja", 96 "pw_console/templates/repl_output.jinja", 97 ], 98 imports = ["."], 99 deps = [ 100 ":event_count_history", 101 ":pyserial_wrapper", 102 "//pw_cli/py:pw_cli", 103 "//pw_config_loader/py:pw_config_loader", 104 "//pw_log_tokenized/py:pw_log_tokenized", 105 "@python_packages_jinja2//:pkg", 106 "@python_packages_prompt_toolkit//:pkg", 107 "@python_packages_ptpython//:pkg", 108 "@python_packages_pygments//:pkg", 109 "@python_packages_pyperclip//:pkg", 110 "@python_packages_pyyaml//:pkg", 111 "@python_packages_websockets//:pkg", 112 ], 113) 114 115py_binary( 116 name = "pw_console_test_mode", 117 srcs = [ 118 "pw_console/__main__.py", 119 ], 120 main = "pw_console/__main__.py", 121 deps = [ 122 ":pw_console", 123 ], 124) 125 126py_test( 127 name = "command_runner_test", 128 size = "small", 129 srcs = [ 130 "command_runner_test.py", 131 ], 132 deps = [ 133 ":pw_console", 134 ], 135) 136 137py_test( 138 name = "console_app_test", 139 size = "small", 140 srcs = [ 141 "console_app_test.py", 142 ], 143 deps = [ 144 ":pw_console", 145 ], 146) 147 148py_test( 149 name = "console_prefs_test", 150 size = "small", 151 srcs = [ 152 "console_prefs_test.py", 153 ], 154 deps = [ 155 ":pw_console", 156 ], 157) 158 159py_test( 160 name = "help_window_test", 161 size = "small", 162 srcs = [ 163 "help_window_test.py", 164 ], 165 deps = [ 166 ":pw_console", 167 ], 168) 169 170py_test( 171 name = "log_filter_test", 172 size = "small", 173 srcs = [ 174 "log_filter_test.py", 175 ], 176 deps = [ 177 ":pw_console", 178 "@python_packages_parameterized//:pkg", 179 ], 180) 181 182py_test( 183 name = "log_store_test", 184 size = "small", 185 srcs = [ 186 "log_store_test.py", 187 ], 188 deps = [ 189 ":pw_console", 190 ], 191) 192 193py_test( 194 name = "log_view_test", 195 size = "small", 196 srcs = [ 197 "log_view_test.py", 198 ], 199 deps = [ 200 ":pw_console", 201 "@python_packages_parameterized//:pkg", 202 ], 203) 204 205py_test( 206 name = "socket_client_test", 207 size = "small", 208 srcs = [ 209 "socket_client_test.py", 210 ], 211 deps = [ 212 ":pw_console", 213 ], 214) 215 216py_test( 217 name = "repl_pane_test", 218 size = "small", 219 srcs = [ 220 "repl_pane_test.py", 221 ], 222 deps = [ 223 ":pw_console", 224 ], 225) 226 227py_test( 228 name = "table_test", 229 size = "small", 230 srcs = [ 231 "table_test.py", 232 ], 233 deps = [ 234 ":pw_console", 235 "@python_packages_parameterized//:pkg", 236 ], 237) 238 239py_test( 240 name = "text_formatting_test", 241 size = "small", 242 srcs = [ 243 "text_formatting_test.py", 244 ], 245 deps = [ 246 ":pw_console", 247 "@python_packages_parameterized//:pkg", 248 ], 249) 250 251py_test( 252 name = "window_manager_test", 253 size = "small", 254 srcs = [ 255 "window_manager_test.py", 256 ], 257 deps = [ 258 ":pw_console", 259 ], 260) 261