eclipse-uprotocol / up-spec

uProtocol Specifications
Apache License 2.0
31 stars 25 forks source link

*Possible* Issue with Imports in protofiles #160

Closed matthewd0123 closed 3 months ago

matthewd0123 commented 3 months ago

@stevenhartley ,

Wanted to bring this up now since I just noticed it and don't want it to pass through any freezes.

I'm seeing an issue when compiling the protobufs for python. It could be something I can/should fix, and I'll investigate more. Basically, what I'm seeing is, some of your imports in protofiles are causing the python proto compiler to output invalid python files.

Example: import "v1/uri.proto"; import "v1/uuid.proto"; import "v1/ustatus.proto";

these are in uattributes.proto. When running "mvn protobuf:compile-python" I get

from v1 import uprotocol.proto.uri_pb2 as v1_dot_uripb2 from v1 import uprotocol.proto.uuid_pb2 as v1_dot_uuid__pb2 from v1 import uprotocol.proto.ustatus_pb2 as v1_dot_ustatuspb2

Which isn't a valid python import statement.

I'll dig a bit and see if there's a way to make that import work without breaking the compiled protos.

matthewd0123 commented 3 months ago

Turns out it's an issue with some internal protofiles that my team has been working with, we have a workaround