With some delay, this is a PR for https://github.com/grpc/grpc/issues/32564 (and previously https://github.com/grpc/grpc/pull/31791). I looked into adding a regular `py_test` for this change [as suggested](https://github.com/grpc/grpc/pull/31791#issuecomment-1423245116) but I am not aware of any effect that the presence of a .pyi stub file would have at runtime and where some sort of type-checking in a .py script would be affected. Stub files are only for use by type checkers & IDE's. I mean, something like this would work: ``` import helloworld_pb2 py_file = helloworld_pb2.__file__ pyi_file = py_file + 'i’ self.assertTrue(os.path.exists(pyi_file)) ``` But that seems really hacky to me. Instead I created a simple rule test for `py_proto_library` with Bazel Skylib which tests the declared outputs for an example `py_proto_library` target. Indirectly, this also tests that the declared output files are actually generated. Please let me know if this is sufficient. |
||
|---|---|---|
| .. | ||
| in_subpackage | ||
| namespaced/upper/example | ||
| subdir | ||
| tools | ||
| .bazelrc | ||
| .gitignore | ||
| BUILD | ||
| README.md | ||
| WORKSPACE | ||
| helloworld.proto | ||
| helloworld.py | ||
| helloworld_moved.py | ||
| import_from_proto_library_package.py | ||
| import_from_this_package.py | ||
| python_rules_test.bzl | ||
| transitive_proto_dep.py | ||
README.md
Bazel Workspace Test
This directory houses a test ensuring that downstream projects can use
@com_github_grpc_grpc//src/python/grpcio:grpcio, py_proto_library, and
py_grpc_library.