chore: depend on authorizer-proto instead of vendored _grpc stubs#9
Merged
Conversation
Replace the hand-copied src/authorizer/_grpc stubs with the versioned PyPI package authorizer-proto (import package authorizer_proto). - Removes the fragile cross-repo copy step that let the vendored stubs go stale (the drift behind authorizer#726 / authorizer-py#8). - authorizer-proto regenerates itself straight from buf.build/authorizerdev/authorizer, so there is no manual copy to forget. - Repoint the two stub imports (_proto.py, _grpc_transport.py) from ._grpc.authorizer.v1 to authorizer_proto.authorizer.v1. - Drop the _grpc ruff/mypy excludes; ignore authorizer_proto.* in mypy (generated, untyped). - REST transport unaffected: grpc-gateway JSON uses the same proto message types, now sourced from the package.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the hand-copied
src/authorizer/_grpcprotobuf/gRPC stubs with the versioned PyPI packageauthorizer-proto(import packageauthorizer_proto), mirroring theprometheus/client_modelpattern. This removes the cross-repo copy step that let the vendored stubs go stale (the drift behind authorizerdev/authorizer#726 / #8).authorizer-protomust be published to PyPI first (see below). Until then,pip installof this branch cannot resolveauthorizer-proto>=0.1.0and CI will fail at the install step. The package is taggedv0.1.0and builds/imports clean; it needs a maintainer withPYPI_API_TOKENto publish (push thev0.1.0tag through its release workflow, ortwine upload).Changes
src/authorizer/_grpc/(vendored stubs, ~5k lines).authorizer-proto>=0.1.0todependencies;[grpc]extra pullsauthorizer-proto[grpc]._proto.py,_grpc_transport.py):._grpc.authorizer.v1->authorizer_proto.authorizer.v1._grpcruff/mypy excludes; ignoreauthorizer_proto.*in mypy (generated, untyped).authorizer-protoregenerates itself directly frombuf.build/authorizerdev/authorizer(BSR) — no manual copy to forget.Testing (local, against
authorizer-protov0.1.0 installed from source)ruff check src tests— All checks passed.mypy src— Success, no issues in 12 source files.pytest -m "not live"— 112 passed, 63 deselected.pytest tests/integration -m live(graphql+rest+grpc) againstquay.io/authorizer/authorizer:2.4.0-rc.9— 63 passed.uv build --wheel— builds clean.Structural dependency change — leaving for human review, not self-merging.