danielgtaylor / danielgtaylor/python-betterproto

Make `grpclib` dependency optional

Open
#565 1 comment 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
1.8k
Forks
234
PR merge metrics
No merged PRs in 30d

Description

First off, thank you for this tool, I was barely able to work with the Python code that protoc generates by default.

I believe that for my usecase, the `grpclib` dependency (and the indirect dependency on four other packages) is unnecessary, and it might be worth thinking about making it optional, and enabling it via an extra. I assume this would be a breaking change, since I don't think you can make extras enabled by default. But maybe it's an idea for v2 or a future major release.

Basically all I need is to decode messages arriving from a socket. For that I don't need more than what is imported in the generated files: `Message`, `Enum`, and the `*_field` functions. As far as I can tell, these do not depend on `grpclib`.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names the generated files and their Message, Enum, and *_field imports; inspect those entry points first, then trace where grpclib is declared and required. Done means the decoding-only path no longer requires grpclib while gRPC support remains explicitly available, with dependency behavior verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.