lbryio / lbryio/types

Post-process python generated files to fix relative import bug

Open
#18 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: improvement
Dominant language
JavaScript
Stars
8
Forks
8
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the generated Python code and the lbrynet/schema/Makefile referenced in the issue, then read the linked protobuf issue for the import behavior. Clarify whether the goal is to post-process generated files or copy the proto files into lbrynet, and consider the work done when lbrynet can import the generated code as a module.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.