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.
There is no separate install_proto command; generated files (e.g. _pb2.py
files) are placed in the source tree and expected to be installed by other
install commands.
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'
# Optionally, set a proto file search path (`--proto_path` or `-I` option to protoc)
proto_path = "src"
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file setuptools_protobuf-0.1.16.tar.gz.
File metadata
- Download URL: setuptools_protobuf-0.1.16.tar.gz
- Upload date:
- Size: 14.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07f08b8cc49685169244c762cdd4f3375b115194ce2c5961907b360a4f47e510
|
|
| MD5 |
f710e0b9e10e24169aa1dfab91bed9f4
|
|
| BLAKE2b-256 |
add672de3eb4eff299ad704156018888cfb67a8fc458245ac4c5dc8d2876e8fb
|
Provenance
The following attestation bundles were made for setuptools_protobuf-0.1.16.tar.gz:
Publisher:
python-distributions.yml on jelmer/setuptools-protobuf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
setuptools_protobuf-0.1.16.tar.gz -
Subject digest:
07f08b8cc49685169244c762cdd4f3375b115194ce2c5961907b360a4f47e510 - Sigstore transparency entry: 652889442
- Sigstore integration time:
-
Permalink:
jelmer/setuptools-protobuf@bae7e02a81398ac7d07556263f241703f5b70295 -
Branch / Tag:
refs/tags/v0.1.16 - Owner: https://github.com/jelmer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-distributions.yml@bae7e02a81398ac7d07556263f241703f5b70295 -
Trigger Event:
push
-
Statement type:
File details
Details for the file setuptools_protobuf-0.1.16-py3-none-any.whl.
File metadata
- Download URL: setuptools_protobuf-0.1.16-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccdecaef75135ae86d15b05f1ec8264cb12e922121910a900d0dddcc07ed31b4
|
|
| MD5 |
5111764c8d9bac58681c42f4e0230a01
|
|
| BLAKE2b-256 |
22abd69f99056c24af77e0f4eb8a2af2ca39929f91415e27a6b26df6ad711c72
|
Provenance
The following attestation bundles were made for setuptools_protobuf-0.1.16-py3-none-any.whl:
Publisher:
python-distributions.yml on jelmer/setuptools-protobuf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
setuptools_protobuf-0.1.16-py3-none-any.whl -
Subject digest:
ccdecaef75135ae86d15b05f1ec8264cb12e922121910a900d0dddcc07ed31b4 - Sigstore transparency entry: 652889450
- Sigstore integration time:
-
Permalink:
jelmer/setuptools-protobuf@bae7e02a81398ac7d07556263f241703f5b70295 -
Branch / Tag:
refs/tags/v0.1.16 - Owner: https://github.com/jelmer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-distributions.yml@bae7e02a81398ac7d07556263f241703f5b70295 -
Trigger Event:
push
-
Statement type: