Replace mypy-protobuf with protobuf pyi_out
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 5.1k
- Forks
- 2.1k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 82
Beschreibung
I noticed that pyi_out is a lot cleaner and more readable that mypy-protobuf. Since pyi generation is part of protobuf it is probably prefered instead of unofficial mypy_protobuf.
And there is also one interesting sideeffect that enums constants are not compatible between themselves exposing couple of bugs in our code.
For example:
enum EnumA {
A_A = 0;
A_B = 1;
}
enum EnumB {
B_A = 0;
B_B = 1;
}
message Msg {
EnumA name = 1;
}
mypy is not bothered that name can also be used with B_A and B_B. But it works with pyi_out generated code.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, die Repository-Konfiguration oder Skripte zu finden, die mypy-protobuf aufrufen, und untersuche, wie generierte Python-Stubs verwendet werden. Vergleiche die aktuelle Ausgabe mit dem Verhalten von protobufs pyi_out und überprüfe anschließend, dass der Ersatz die erwarteten Stubs beibehält und verhindert, dass inkompatible Enum-Konstanten akzeptiert werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- tooling
- Issue-Typ
- Refactoring
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100