danielgtaylor / danielgtaylor/python-betterproto

Issue importing structures between files in subpackages

Open
#154 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.8k
Forks
234
PR merge metrics
No merged PRs in 30d

Description

Given a file like...

```
import "badger/mushroom";

package badger.snake;

message Snake {
badger.mushroom.Mushroom mushroom = ...;
}
```

This results in compiling a `badger/snake.py` which includes the line `from .badger import mushroom` instead of `from . import mushroom`.

Contributor guide

Open the contributing guide

Research direction

Reproduce the example with the badger.mushroom import and badger.snake package, then inspect the generated badger/snake.py. Trace how the compiler resolves imports between subpackages; done means the generated file uses `from . import mushroom` and still compiles correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.