Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate the compiler and the lib source code #648

Open
AdrienVannson opened this issue Nov 25, 2024 · 1 comment
Open

Separate the compiler and the lib source code #648

AdrienVannson opened this issue Nov 25, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@AdrienVannson
Copy link
Contributor

AdrienVannson commented Nov 25, 2024

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

@AdrienVannson AdrienVannson added the enhancement New feature or request label Nov 25, 2024
@Gobot1234
Copy link
Collaborator

I'd like to also separate the services into another module so you can choose what dependencies you want

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants