Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not fixing imports in pyi files #850

Open
juraj-juraj opened this issue Apr 26, 2023 · 0 comments
Open

Not fixing imports in pyi files #850

juraj-juraj opened this issue Apr 26, 2023 · 0 comments

Comments

@juraj-juraj
Copy link

I'm working on a project with nested structure where are shared objects in directories.
This is how directory structure looks like.

phonexia
- common
   - core.proto
   - health_check.proto
- technologies
   -  speaker
      -  v1
         -  sid.proto # imports "pkg_name/common/core.proto"

Protoc generates python libraries, name_pb2.py, name_pb2_grpc.py and name_pb2.pyi. The last one is interface file. The files are generated all right. Protol then fixes imports, but only in .py files, .pyi files are left untouched.
It looks like it is only mistake in rewriting patterns. Because imports in .py files look like: "from phonexia.common import core_pb2 as pkg_name_dot_common_dot_core__pb2", but in pyi files imports are like: "from phonexia.common import core_pb2 as _core_pb2". I tried renaming import in pyi files and it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant