• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2021 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
15import("//build_overrides/pigweed.gni")
16
17import("$dir_pw_build/python.gni")
18import("$dir_pw_docgen/docs.gni")
19import("$dir_pw_rpc/internal/integration_test_ports.gni")
20
21pw_python_package("py") {
22  generate_setup = {
23    metadata = {
24      name = "pw_rpc"
25      version = "0.0.1"
26    }
27    options = {
28      install_requires = [ "protobuf" ]
29    }
30  }
31
32  sources = [
33    "pw_rpc/__init__.py",
34    "pw_rpc/callback_client/__init__.py",
35    "pw_rpc/callback_client/call.py",
36    "pw_rpc/callback_client/errors.py",
37    "pw_rpc/callback_client/impl.py",
38    "pw_rpc/client.py",
39    "pw_rpc/codegen.py",
40    "pw_rpc/codegen_nanopb.py",
41    "pw_rpc/codegen_raw.py",
42    "pw_rpc/console_tools/__init__.py",
43    "pw_rpc/console_tools/console.py",
44    "pw_rpc/console_tools/functions.py",
45    "pw_rpc/console_tools/watchdog.py",
46    "pw_rpc/descriptors.py",
47    "pw_rpc/ids.py",
48    "pw_rpc/packets.py",
49    "pw_rpc/plugin.py",
50    "pw_rpc/plugin_nanopb.py",
51    "pw_rpc/plugin_raw.py",
52    "pw_rpc/testing.py",
53  ]
54  tests = [
55    "tests/callback_client_test.py",
56    "tests/client_test.py",
57    "tests/console_tools/console_tools_test.py",
58    "tests/console_tools/functions_test.py",
59    "tests/console_tools/watchdog_test.py",
60    "tests/descriptors_test.py",
61    "tests/ids_test.py",
62    "tests/packets_test.py",
63  ]
64  python_deps = [
65    "$dir_pw_protobuf/py",
66    "$dir_pw_protobuf_compiler/py",
67    "$dir_pw_status/py",
68  ]
69  python_test_deps = [ "$dir_pw_build/py" ]
70  pylintrc = "$dir_pigweed/.pylintrc"
71  proto_library = "..:protos"
72}
73
74pw_doc_group("docs") {
75  sources = [ "docs.rst" ]
76  other_deps = [ ":py" ]
77}
78
79pw_python_script("python_client_cpp_server_test") {
80  sources = [ "tests/python_client_cpp_server_test.py" ]
81  python_deps = [
82    ":py",
83    "$dir_pw_hdlc/py",
84    "$dir_pw_status/py",
85  ]
86  pylintrc = "$dir_pigweed/.pylintrc"
87
88  action = {
89    args = [
90      "--port=$pw_rpc_PYTHON_CLIENT_CPP_SERVER_TEST_PORT",
91      "--test-server-command",
92      "<TARGET_FILE(..:test_rpc_server)>",
93    ]
94    deps = [ "..:test_rpc_server" ]
95    stamp = true
96  }
97}
98