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_pwpb.py", 42 "pw_rpc/codegen_raw.py", 43 "pw_rpc/console_tools/__init__.py", 44 "pw_rpc/console_tools/console.py", 45 "pw_rpc/console_tools/functions.py", 46 "pw_rpc/console_tools/watchdog.py", 47 "pw_rpc/descriptors.py", 48 "pw_rpc/ids.py", 49 "pw_rpc/lossy_channel.py", 50 "pw_rpc/packets.py", 51 "pw_rpc/plugin.py", 52 "pw_rpc/plugin_nanopb.py", 53 "pw_rpc/plugin_pwpb.py", 54 "pw_rpc/plugin_raw.py", 55 "pw_rpc/testing.py", 56 ] 57 tests = [ 58 "tests/callback_client_test.py", 59 "tests/client_test.py", 60 "tests/console_tools/console_tools_test.py", 61 "tests/console_tools/functions_test.py", 62 "tests/console_tools/watchdog_test.py", 63 "tests/descriptors_test.py", 64 "tests/ids_test.py", 65 "tests/packets_test.py", 66 ] 67 python_deps = [ 68 "$dir_pw_protobuf/py", 69 "$dir_pw_protobuf_compiler/py", 70 "$dir_pw_status/py", 71 ] 72 python_test_deps = [ 73 "$dir_pw_build/py", 74 "$dir_pw_log:protos.python", 75 "$dir_pw_tokenizer/py:test_proto.python", 76 ] 77 pylintrc = "$dir_pigweed/.pylintrc" 78 mypy_ini = "$dir_pigweed/.mypy.ini" 79 proto_library = "..:protos" 80} 81 82pw_doc_group("docs") { 83 sources = [ "docs.rst" ] 84 other_deps = [ ":py" ] 85} 86 87pw_python_script("python_client_cpp_server_test") { 88 sources = [ "tests/python_client_cpp_server_test.py" ] 89 python_deps = [ 90 ":py", 91 "$dir_pw_build/py", 92 "$dir_pw_hdlc/py", 93 "$dir_pw_log:protos.python", 94 "$dir_pw_status/py", 95 "$dir_pw_tokenizer/py:test_proto.python", 96 ] 97 98 pylintrc = "$dir_pigweed/.pylintrc" 99 mypy_ini = "$dir_pigweed/.mypy.ini" 100 101 action = { 102 args = [ 103 "--port=$pw_rpc_PYTHON_CLIENT_CPP_SERVER_TEST_PORT", 104 "--test-server-command", 105 "<TARGET_FILE(..:test_rpc_server)>", 106 ] 107 deps = [ "..:test_rpc_server" ] 108 stamp = true 109 } 110} 111