Setuptools protobuf extension plugin
Project description
protobuf support for setuptools
Plugin for setuptools
that adds support for compiling protobuf files.
Dependencies
The plugin requires the external protoc
executable that is part of the
protobuf project to be present.
On Debian systems, this executable is shipped in the protobuf-compiler
package.
If the protoc_version
option is specified, the specified version of protoc
will be downloaded from github. When it is not specified, a protoc
binary is
expected to be present in the environment. You can override the binary with the
PROTOC environment variable.
Optionally, it can also generate typing hints if the mypy
extra is selected.
Usage
You can configure setuptools-protobuf
in either setup.py
, setup.cfg
or pyproject.toml
.
setup.py
from setuptools_protobuf import Protobuf
setup(
...
setup_requires=['setuptools-protobuf'],
protobufs=[Protobuf('example/foo.proto')],
)
setup.cfg
...
[options]
setup_requires =
setuptools
setuptools-protobuf
pyproject.toml
[build-system]
requires = ["setuptools", "setuptools-protobuf"]
[tool.setuptools-protobuf]
protobufs = ["example/foo.proto"]
# Require the generation of typing hints:
mypy = true
# Optionally, set the specific protoc version to use:
protoc_version = '25.1'
GitHub actions
To install protoc in a GitHub action, you can use the setup-protoc action:
- name: Install Protoc
uses: arduino/setup-protoc@v2
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file setuptools-protobuf-0.1.12.tar.gz
.
File metadata
- Download URL: setuptools-protobuf-0.1.12.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c567ab1d081427805720d991688e306b4049946575f19df4f22ba6c8321eac8c |
|
MD5 | a36738b9028b1ba1b98c8293d62e21cb |
|
BLAKE2b-256 | a58767f7050f378b0dff101fed01c436dd8f2d28a4b562dcf006353b8232440e |
File details
Details for the file setuptools_protobuf-0.1.12-py3-none-any.whl
.
File metadata
- Download URL: setuptools_protobuf-0.1.12-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17298b399bf28a5bffcf9d66bb89f83a7b7aa25169a793733de294be024014e5 |
|
MD5 | a1e19e87029a1a64d5d74e36022659d5 |
|
BLAKE2b-256 | 53fed9af1f7c706043db258d3c7d6b479260fbb40dc2d11ba75b77b2abb52719 |