danielgtaylor / danielgtaylor/python-betterproto

Separate the compiler and the lib source code

Offen
#648 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Python
Sterne
1.8k
Forks
234
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

## The Problem

Currently, the code of betterproto's compiler and betterproto's lib are together, in the same repo, same Python environment, etc.

This has several disadvantages:

- The users of already compiled files will still need the source code of betterproto's compiler, even if they will never run it
- If changes are made only on the compiler, all users will be affected and will need to update betterproto even if they are not concerned by the update.
- These two parts of betterproto don't have the same requirements concerning the Python version: we need to support old versions in the library since users may need them... But we should be able to use the latest Python version in the compiler to make the development easier (the users won't be impacted).
- In the same spirit, the compiler part is an application (we can choose the version of the dependencies we rely on), while the lib is a library which should support a wide range of versions for its dependencies.
- The dependencies needed by the compiler are marked as optional to avoid forcing all the users to download them... But it means that these packages may not be installed when using the compiler. For now, an ad-hoc error message is shown, and the users need to manually install the dependencies.

## The Ideal Solution

I think it would be better to split the source code in two parts: the compiler and the library. These two parts would have different Python environment.

## Note

This change has a very low priority, but I think it would be a nice improvement. If we do it, it should be done before v2. I can realize the change later... I'll take about it on Discord soon

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Das Issue nennt keine Dateien, Tests oder Einstiegspunkte. Beginne damit zu erfassen, wo der Quellcode von Compiler und Bibliothek, die Paketierung, die Abhängigkeiten und die Einschränkungen hinsichtlich der Python-Version definiert sind; ermittle anschließend, wie sie als separate Umgebungen verteilt werden können. Als abgeschlossen gilt die Arbeit, wenn Benutzer des Compilers Compiler-Abhängigkeiten benötigen, während Benutzer der Bibliothek die Bibliothek unabhängig installieren und verwenden können und die angegebenen Kompatibilitätsunterschiede erhalten bleiben.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
build-system, tooling
Issue-Typ
Refactoring
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.