• 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_build/python_action_test.gni")
19import("$dir_pw_docgen/docs.gni")
20import("$dir_pw_rpc/internal/integration_test_ports.gni")
21
22pw_python_package("py") {
23  generate_setup = {
24    metadata = {
25      name = "pw_rpc"
26      version = "0.0.1"
27    }
28    options = {
29      install_requires = [
30        "protobuf",
31        "pyserial",
32      ]
33    }
34  }
35
36  sources = [
37    "pw_rpc/__init__.py",
38    "pw_rpc/callback_client/__init__.py",
39    "pw_rpc/callback_client/call.py",
40    "pw_rpc/callback_client/errors.py",
41    "pw_rpc/callback_client/impl.py",
42    "pw_rpc/client.py",
43    "pw_rpc/codegen.py",
44    "pw_rpc/codegen_nanopb.py",
45    "pw_rpc/codegen_pwpb.py",
46    "pw_rpc/codegen_raw.py",
47    "pw_rpc/console_tools/__init__.py",
48    "pw_rpc/console_tools/console.py",
49    "pw_rpc/console_tools/functions.py",
50    "pw_rpc/console_tools/watchdog.py",
51    "pw_rpc/descriptors.py",
52    "pw_rpc/ids.py",
53    "pw_rpc/lossy_channel.py",
54    "pw_rpc/packets.py",
55    "pw_rpc/plugin.py",
56    "pw_rpc/plugin_nanopb.py",
57    "pw_rpc/plugin_pwpb.py",
58    "pw_rpc/plugin_raw.py",
59    "pw_rpc/testing.py",
60  ]
61  tests = [
62    "tests/callback_client_test.py",
63    "tests/client_test.py",
64    "tests/console_tools/console_tools_test.py",
65    "tests/console_tools/functions_test.py",
66    "tests/console_tools/watchdog_test.py",
67    "tests/descriptors_test.py",
68    "tests/ids_test.py",
69    "tests/packets_test.py",
70  ]
71  python_deps = [
72    "$dir_pw_protobuf/py",
73    "$dir_pw_protobuf_compiler/py",
74    "$dir_pw_status/py",
75  ]
76  python_test_deps = [
77    "$dir_pw_build/py",
78    "$dir_pw_log:protos.python",
79    "$dir_pw_tokenizer/py:test_proto.python",
80  ]
81  pylintrc = "$dir_pigweed/.pylintrc"
82  mypy_ini = "$dir_pigweed/.mypy.ini"
83  proto_library = "..:protos"
84}
85
86pw_doc_group("docs") {
87  sources = [ "docs.rst" ]
88  other_deps = [ ":py" ]
89}
90
91pw_python_action_test("python_client_cpp_server_test") {
92  sources = [ "tests/python_client_cpp_server_test.py" ]
93  python_deps = [
94    ":py",
95    "$dir_pw_build/py",
96    "$dir_pw_hdlc/py",
97    "$dir_pw_log:protos.python",
98    "$dir_pw_status/py",
99    "$dir_pw_tokenizer/py:test_proto.python",
100  ]
101  args = [
102    "--port=$pw_rpc_PYTHON_CLIENT_CPP_SERVER_TEST_PORT",
103    "--test-server-command",
104    "<TARGET_FILE(..:test_rpc_server)>",
105  ]
106  deps = [ "..:test_rpc_server" ]
107  tags = [ "integration" ]
108}
109