danielgtaylor / danielgtaylor/python-betterproto

Relative imports

Aperta
#470 1 commento 3 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
1.8k
Fork
234
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Certainly I had the same issue with the original protoc compiler, but generated relative imports are complaining. I have a bunch of protos in the same directory.

I'm using the cmd line to generate the dataclasses:

```python -m grpc_tools.protoc -I C:\dir\libroot --python_betterproto_out=src\libs C:\dir\libroot\Protos\myproto.proto```

This generates the proto files in the expected location `src\libs\packagename\myproto.py`, with the following imports, which don't work:

```from .packagename import common```

However (in my use case) this needs to be:

```from . import common```

But perhaps I've got the wrong end of the stick!

Thanks.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.