-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
proto directory names preclude using protos in python code #1647
Comments
Hi Steven, thanks for your interest in the project! This is moderately absurd, but lets see if we can figure something out. What protos exactly is it you're struggling to import? I assume you're talking about https://github.com/grpc-ecosystem/grpc-gateway/tree/master/protoc-gen-swagger/options? How are you importing them? It should really be possible for you to build them in your own folder structure, and so decide your own paths. Indeed, our README encourages users to copy the proto dependencies to their own protofile trees. If you take a look at my boilerplate repo, you can see that there is a Indeed, I don't think we could make this change, so hopefully we can find a workaround. If you want more synchronous discussion, feel free to drop into our Slack support channel (#grpc-gateway on Gophers Slack). |
Yes, both protos in
We use
Yeah, for what it's worth, we've succeeded in not doing this for any other external protos. Among others, we use external repos for I understand that you might not have the appetite to make this change. We have a fork that renames the directory and adds a |
Happy to close this, leaving it for others that wish to take the same approach ... |
Sorry that it had to be a fork, but thanks for raising the issue! That's a really unfortunate shortcoming of the Python proto rules. |
The use of dashes in proto directory names precludes using those protos in python.
protoc
uses the path of the proto as the path of the generated python file name and so has to be a valid python package/module name.There have been issues posted against protobuf asking to support a
python_package
option as there is ago_package
option but resulting comments have mentioned that this would be problematic, particularly forbazel
/blaze
:protocolbuffers/protobuf#7061
protocolbuffers/protobuf#2283
protocolbuffers/protobuf#973
So the question is, is there any tolerance for renaming the directories here so that the protos can be imported as external repos?
I can imagine this could be a breaking change for people using the project ...
The text was updated successfully, but these errors were encountered: