Post-process python generated files to fix relative import bug #18

Open
opened 2019-01-28 19:54:14 +01:00 by lyoshenka · 0 comments
lyoshenka commented 2019-01-28 19:54:14 +01:00 (Migrated from github.com)

lbrynet cannot directly import the generated python code. I think the problem is that protobuf generates files with absolute import paths, and py3 needs them to be relative so they can be imported.

protobuf issue: https://github.com/protocolbuffers/protobuf/issues/1491

our hacky solution: https://github.com/lbryio/lbry/blob/master/lbrynet/schema/Makefile

This is only necessary if we want to use types repo as a module. An alternative is to copy-paste the proto files into lbrynet repo, and then generate the protobufs there.

lbrynet cannot directly import the generated python code. I think the problem is that protobuf generates files with absolute import paths, and py3 needs them to be relative so they can be imported. protobuf issue: https://github.com/protocolbuffers/protobuf/issues/1491 our hacky solution: https://github.com/lbryio/lbry/blob/master/lbrynet/schema/Makefile This is only necessary if we want to use types repo as a module. An alternative is to copy-paste the proto files into lbrynet repo, and then generate the protobufs there.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/types#18
No description provided.