# 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](https://github.com/protocolbuffers/protobuf) 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
```python
from setuptools_protobuf import Protobuf
setup(
...
setup_requires=['setuptools-protobuf'],
protobufs=[Protobuf('example/foo.proto')],
)
```
### setup.cfg
```ini
...
[options]
setup_requires =
setuptools
setuptools-protobuf
```
### pyproject.toml
```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](https://github.com/arduino/setup-protoc) action:
```yaml
- name: Install Protoc
uses: arduino/setup-protoc@v2
```
Raw data
{
"_id": null,
"home_page": "",
"name": "setuptools-protobuf",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "distutils,setuptools,protobuf",
"author": "",
"author_email": "Jelmer Vernoo\u0133 <jelmer@jelmer.uk>",
"download_url": "https://files.pythonhosted.org/packages/a5/87/67f7050f378b0dff101fed01c436dd8f2d28a4b562dcf006353b8232440e/setuptools-protobuf-0.1.12.tar.gz",
"platform": null,
"description": "# protobuf support for setuptools\n\nPlugin for `setuptools` that adds support for compiling protobuf files.\n\n## Dependencies\n\nThe plugin requires the external ``protoc`` executable that is part of the\n[protobuf project](https://github.com/protocolbuffers/protobuf) to be present.\nOn Debian systems, this executable is shipped in the ``protobuf-compiler`` package.\n\nIf the ``protoc_version`` option is specified, the specified version of protoc\nwill be downloaded from github. When it is not specified, a ``protoc`` binary is\nexpected to be present in the environment. You can override the binary with the\nPROTOC environment variable.\n\nOptionally, it can also generate typing hints if the ``mypy`` extra is selected.\n\n## Usage\n\nYou can configure `setuptools-protobuf` in either `setup.py`, `setup.cfg` or `pyproject.toml`.\n\n### setup.py\n\n```python\nfrom setuptools_protobuf import Protobuf\n\nsetup(\n...\n setup_requires=['setuptools-protobuf'],\n protobufs=[Protobuf('example/foo.proto')],\n)\n```\n\n### setup.cfg\n\n```ini\n...\n\n[options]\nsetup_requires =\n setuptools\n setuptools-protobuf\n```\n\n### pyproject.toml\n\n```toml\n[build-system]\nrequires = [\"setuptools\", \"setuptools-protobuf\"]\n\n[tool.setuptools-protobuf]\nprotobufs = [\"example/foo.proto\"]\n\n# Require the generation of typing hints:\nmypy = true\n\n# Optionally, set the specific protoc version to use:\nprotoc_version = '25.1'\n```\n\n## GitHub actions\n\nTo install protoc in a GitHub action, you can use the\n[setup-protoc](https://github.com/arduino/setup-protoc) action:\n\n```yaml\n- name: Install Protoc\n uses: arduino/setup-protoc@v2\n```\n",
"bugtrack_url": null,
"license": "Apachev2",
"summary": "Setuptools protobuf extension plugin",
"version": "0.1.12",
"project_urls": {
"homepage": "https://github.com/jelmer/setuptools-protobuf"
},
"split_keywords": [
"distutils",
"setuptools",
"protobuf"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "53fed9af1f7c706043db258d3c7d6b479260fbb40dc2d11ba75b77b2abb52719",
"md5": "a1e19e87029a1a64d5d74e36022659d5",
"sha256": "17298b399bf28a5bffcf9d66bb89f83a7b7aa25169a793733de294be024014e5"
},
"downloads": -1,
"filename": "setuptools_protobuf-0.1.12-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a1e19e87029a1a64d5d74e36022659d5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 9191,
"upload_time": "2024-01-28T00:33:15",
"upload_time_iso_8601": "2024-01-28T00:33:15.393221Z",
"url": "https://files.pythonhosted.org/packages/53/fe/d9af1f7c706043db258d3c7d6b479260fbb40dc2d11ba75b77b2abb52719/setuptools_protobuf-0.1.12-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a58767f7050f378b0dff101fed01c436dd8f2d28a4b562dcf006353b8232440e",
"md5": "a36738b9028b1ba1b98c8293d62e21cb",
"sha256": "c567ab1d081427805720d991688e306b4049946575f19df4f22ba6c8321eac8c"
},
"downloads": -1,
"filename": "setuptools-protobuf-0.1.12.tar.gz",
"has_sig": false,
"md5_digest": "a36738b9028b1ba1b98c8293d62e21cb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 10113,
"upload_time": "2024-01-28T00:33:17",
"upload_time_iso_8601": "2024-01-28T00:33:17.249181Z",
"url": "https://files.pythonhosted.org/packages/a5/87/67f7050f378b0dff101fed01c436dd8f2d28a4b562dcf006353b8232440e/setuptools-protobuf-0.1.12.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-28 00:33:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jelmer",
"github_project": "setuptools-protobuf",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "setuptools-protobuf"
}