Skip to content

Conversation

@AdrienVannson
Copy link
Contributor

@AdrienVannson AdrienVannson commented Sep 6, 2025

Fix #84

@AdrienVannson AdrienVannson changed the title Add dependencies workflow Make grpclib truly optional Sep 6, 2025
Copy link

Copilot AI left a 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.

@AdrienVannson AdrienVannson merged commit 518f507 into main Sep 13, 2025
17 checks passed
@AdrienVannson AdrienVannson deleted the make-grpclib-optional branch September 13, 2025 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make grpclib truly optional

2 participants