Skip to main content

Plugin for setuptools and grpc / protobuf python module build

Project description

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

Project details


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.2.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: setuptools-grpc-0.2.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for setuptools-grpc-0.2.tar.gz
Algorithm Hash digest
SHA256 01234d64032db691e04890c0bbbeb8a0089898e094a4d2cb05105dcda9c13fc0
MD5 8e3496ab3b13903ab67d9b966102daa4
BLAKE2b-256 ff837ff935e5d3ab4860378f3aab82d3bc411543a1d41d37a897e8e54d12783f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: setuptools_grpc-0.2-py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for setuptools_grpc-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 34302dfedc095453034af085e5cfd4d2ef9d41f14d28710a2ccca2fc782f5e05
MD5 baff1cdf70c4e662af6252df3d60dd28
BLAKE2b-256 03d01ff223a4f7f82fed3975df41adb1c95849c57e8acf78ce5d410973a17265

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page