Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pierlauro/protobufferize
Compile protobuffers via setuptools
https://github.com/pierlauro/protobufferize
grpc grpc-python proto protobuf protobuffer protobufferize protocol-buffers protos python3 setuptools
Last synced: 17 days ago
JSON representation
Compile protobuffers via setuptools
- Host: GitHub
- URL: https://github.com/pierlauro/protobufferize
- Owner: pierlauro
- License: agpl-3.0
- Created: 2019-10-30T09:15:10.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-22T18:04:22.000Z (about 4 years ago)
- Last Synced: 2024-09-18T01:57:49.721Z (about 2 months ago)
- Topics: grpc, grpc-python, proto, protobuf, protobuffer, protobufferize, protocol-buffers, protos, python3, setuptools
- Language: Python
- Homepage:
- Size: 36.1 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
## protobufferize
A simple setuptools plugin to compile proto files at build time.
### Installation
Install from PyPI: ```pip3 install protobufferize```
### Configuration
Available configuration parameters:
- `clearOutputDirectory` [default: false]
- `grpcOutputDirectory` [default: None]
- `outputDirectory` [default: ./output]
- `protoSourceRoot` [default: ./protos]
- `protoVersion` [default: 3.10.1]XML configuration example:
```xml
false
test_data/grpc_output
test_data/output
test_data/protos
3.10.1```
A xml configuration file named `protobufferize.xml` should be put in the python's project root folder.
In alternative, the configuration file's path can be specified in the environment variable `protobufferize_conf`.### Usage
Compile every `.proto` file in `protoSourceRoot` subdirectories and output in the specified `outputDirectory` (`outputDirectory` gets emptied beforewards if `clearOutputDirectory` set to `true`).
```sh
python3 setup.py protobufferize
```### Internal details
By default, the specified version of `protoc` binary is downloaded and executed to compile the profo files.If `grpcOutputDirectory` is set - instead - the latest `grpc-tools` pypi package is used (and the `protoc` version is ignored for compatibility problems).