bazel: Missing Python rules

- Update com_google_protobuf to 3.17.3, allows proto3 compiling.
- Use filegroup for common Python sources in pw_protobuf and rpc
- Add pw_cli py_tests

No-Docs-Update-Reason: Bazel fixes
Change-Id: I7ca506365981e3cf74224ae48dc1a05724c5f4bd
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/57720
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
diff --git a/pw_transfer/BUILD.bazel b/pw_transfer/BUILD.bazel
index fada112..54065f2 100644
--- a/pw_transfer/BUILD.bazel
+++ b/pw_transfer/BUILD.bazel
@@ -12,11 +12,10 @@
 # License for the specific language governing permissions and limitations under
 # the License.
 
-load(
-    "//pw_build:pigweed.bzl",
-    "pw_cc_library",
-    "pw_cc_test",
-)
+load("//pw_build:pigweed.bzl", "pw_cc_library", "pw_cc_test")
+load("//pw_protobuf_compiler:proto.bzl", "pw_proto_library")
+load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")
+load("@rules_proto//proto:defs.bzl", "proto_library")
 
 package(default_visibility = ["//visibility:public"])
 
@@ -41,9 +40,16 @@
         "//pw_bytes",
         "//pw_containers:intrusive_list",
         "//pw_log",
+        "//pw_protobuf",
         "//pw_result",
         "//pw_status",
         "//pw_stream",
+        ":transfer_pwpb",
+        "//pw_rpc:internal_packet_pwpb",
+        # "//pw_rpc:server",
+        "//pw_rpc/raw:method_union",
+        # "//pw_rpc/raw:test_method_context",
+        "//pw_rpc:internal_test_utils",
     ],
 )
 
@@ -73,6 +79,22 @@
         ":pw_transfer",
         "//pw_log",
         "//pw_rpc/system_server",
-        "//pw_rpc/system_server:socket",
     ],
 )
+
+proto_library(
+    name = "transfer_proto",
+    srcs = [
+        "transfer.proto",
+    ],
+)
+
+pw_proto_library(
+    name = "transfer_pwpb",
+    deps = [":transfer_proto"],
+)
+
+py_proto_library(
+    name = "transfer_proto_pb2",
+    srcs = ["transfer.proto"],
+)