-
Notifications
You must be signed in to change notification settings - Fork 14
Make grpclib truly optional #139
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR makes grpclib truly optional by restructuring imports and introducing dependency-specific test fixtures. It addresses scenarios where grpclib may not be available in the environment while still allowing the core betterproto2 functionality to work.
Key changes:
- Moves grpclib-specific imports into a conditional module structure
- Adds pytest fixtures to skip tests when optional dependencies are not available
- Updates test generation to use different client generation modes based on grpclib availability
Reviewed Changes
Copilot reviewed 31 out of 34 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| betterproto2/src/betterproto2/grpclib/init.py | New module providing grpclib imports in a conditional structure |
| betterproto2/src/betterproto2/init.py | Removes direct grpclib import from main module |
| betterproto2_compiler/src/betterproto2_compiler/templates/*.j2 | Updates templates to use qualified grpclib imports |
| betterproto2_compiler/tests/*.py | Adds client_generation parameter support |
| betterproto2/tests/*.py | Adds dependency check fixtures and updates test imports |
| .github/workflows/ci.yml | Adds CI job to test without optional dependencies |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Fix #84