Skip to main content

Plugin for setuptools to compile protobuf and gRPC service files to python modules.

Usage

This package provides build_grpc command.

Run python setup.py build_grpc for available options.

Options

Command build_grpc provides following options:

  • proto_files: Newline separated list of glob patterns matching protobuf files to be compiled. Paths are relative to the current directory. ** can be used to match any files and zero or more directories. Default value is empty list.

  • grpc_files: Newline separated list of glob patterns matching grpc service files to be compiled. Paths are relative to the current directory. ** can be used to match any files and zero or more directories. Default value is empty list.

  • proto_path: Path to root directory with protobuf files. This path is passed through -I option to grpc_tools.protoc. Default is . (current directory).

  • output_path: Path to root directory for generated python modules. This path is passed through --python_out or --grpc_python_out option to grpc_tools.protoc. Default is . (current directory).

Example

# pyproject.toml
[build-system]
requires = ["setuptools", "setuptools-grpc"]
build-backend = "setuptools.build_meta"
# setup.py
from distutils.command.build import build
from setuptools import setup

class custom_build(build):
    sub_commands = [
        ('build_grpc', None),
    ] + build.sub_commands

setup(cmdclass={'build': custom_build})
# setup.cfg
[build_grpc]
proto_files = src/**/*.proto
grpc_files = src/**/*_grpc.proto
proto_path = ./src
output_path = ./out

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

setuptools-grpc-0.4.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

setuptools_grpc-0.4-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file setuptools-grpc-0.4.tar.gz.

File metadata

  • Download URL: setuptools-grpc-0.4.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for setuptools-grpc-0.4.tar.gz
Algorithm Hash digest
SHA256 c1ad6b0db22927ed01ab3e48d8f5bb62b6fcdebdb007f085e16b8d438995c87f
MD5 cb80e7b32e8e1c6c59fd34ab48eba57e
BLAKE2b-256 4dc9e24a35cb7c891cc4126bf38ba1457c8f52ba18d7b144776ab343d2e1efcf

See more details on using hashes here.

File details

Details for the file setuptools_grpc-0.4-py3-none-any.whl.

File metadata

  • Download URL: setuptools_grpc-0.4-py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for setuptools_grpc-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8dd67a0b6ffdcb122906d2ac33e41bb68f50483f71de94797a3835a6b3c47406
MD5 fa99fd41f68efc49097dd2af93544c22
BLAKE2b-256 97ad3b54213adf97f39142ef933607757a06ee8cd889c37f01c6a3c21f59f4da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page