Skip to main content

Poetry gRPC plugin

A Poetry plugin to run the Protocol Buffers compiler with gRPC support.

Installing the plugin

Requires Poetry version 1.2.0 or above

poetry self add poetry-grpc-plugin

Usage

To run it manually:

poetry help protoc

Usage:
  protoc [options]

Options:
      --proto_path[=PROTO_PATH]             Base path for protobuf resources. [default: "<module_name>"]
      --python_out[=PYTHON_OUT]             Output path for generated protobuf wrappers. [default: "."]
      --grpc_python_out[=GRPC_PYTHON_OUT]   Output path for generated gRPC wrappers. Defaults to same path as python_out.
      --mypy_out[=MYPY_OUT]                 Output path for mypy type information for generated protobuf wrappers. Defaults to same path as python_out.
      --mypy_grpc_out[=MYPY_GRPC_OUT]       Output path for mypy type information for generated gRPC wrappers. Defaults to same path as grpc_python_out.
      --venv_proto_paths[=VENV_PROTO_PATHS] Additional protobuf resources paths, from the plugin's venv. Defaults to None.
      ...

Run on poetry update

[tool.poetry-grpc-plugin]

Additional config

[tool.poetry-grpc-plugin]
proto_path = "protos"               # Defaults to module name
python_out = "."                    # Defaults to .
venv_proto_paths = ["google/type"]  # Defaults to None

Settings in pyproject.toml will be used as defaults for manual execution with poetry protoc.

Using venv_proto_paths, one can import additional protos from packages installed in the same virtual environment as this plugin. For example:

pipx inject poetry googleapis-common-protos
[tool.poetry-grpc-plugin]
...
venv_proto_paths = ["google/type"]  # Defaults to None

Then in your proto file you can do:

import "latlng.proto";

Release files for poetry-grpc-plugin 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for poetry-grpc-plugin 0.1.9
File Size Uploaded
poetry_grpc_plugin-0.1.9.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for poetry-grpc-plugin 0.1.9
File Interpreter ABI Platform
poetry_grpc_plugin-0.1.9-py3-none-any.whl Python 3 none any Details

Total release size: 10.7 kB

Release files / poetry_grpc_plugin-0.1.9.tar.gz

Download URL poetry_grpc_plugin-0.1.9.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e9c494c572e2b225d26c7ad5ad2b4809a478a851a4e53ef2c68376258c64c06a
BLAKE2b-256 checksum
How to use checksums
efe917e59b16214b42b29697960abc9afdb79f1a86353e8d6294c8d3bcb87f66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.12 Linux/6.2.0-1018-azure

Release files / poetry_grpc_plugin-0.1.9-py3-none-any.whl

Download URL poetry_grpc_plugin-0.1.9-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2490d85f8dcbec63daff60fcbe2312afe7041ff30e2b196d9ea6eb6dafc92518
BLAKE2b-256 checksum
How to use checksums
92bd22c8f8cc6607a62878306a86a153cb8a63e182919da67aa2cd5162acd48d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.12 Linux/6.2.0-1018-azure

Release history Release notifications | RSS feed

This release

0.1.9 This release

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

1 release file

0.1.4

1 release file

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page