setuptools-proto
setuptools plugin to compile .proto files using python-betterproto.
Prerequisite
- Protobuf compiler
protoc - Python 3.6+
Enable setuptools-proto
In either of the following scenarios, setuptools-proto will take effects.
- Option 1, install
setuptools-protousingpipor other tools:
$ pip install setuptools-proto
- Option 2, require
setuptools-protoinsetup_requireskeyword ofsetuptools.
So, add it either
setuptools.setup(
setup_requires=['setuptools-proto'],
)
in setup.py in a imperative fashion or
[options]
setup_requires =
setuptools-proto
in seutp.cfg in a declarative manner.
Configuration
Protobuf modules
To let setuptools-proto know what to compile,
define prot_modules as a ProtoModule list.
from setuptools import setup
from setuptools_proto import ProtoModule
module1 = ProtoModule(
['proto/sample/**/*.proto'],
cwd='proto/sample',
)
module2 = ProtoModule(
['demo/grpc/echo.proto', 'demo/grpc/hello.proto'],
cwd='demo/grpc',
out_dir='proto',
include_dirs=['demo/schema'],
)
setup(
proto_modules=[module1, module2],
)
protoc compiler
By default, setuptools-proto will use the system protoc compiler.
If there's a custom install of protoc, which is not in the PATH,
You can point environment variable PROTOC to it,
or command line argument --protoc to it.
For example,
$ python setup.py --protoc /path/to/protoc build_proto
Execute
An extra command build_proto is added, to compile .proto to python code.
This command will be automatically run before command build_py.
Metadata
Release files for setuptools-proto 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| setuptools-proto-1.0.0.tar.gz | 14.8 kB | Without provenance | Details for setuptools-proto-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| setuptools_proto-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for setuptools_proto-1.0.0-py3-none-any.whl |
Total release size: 22.6 kB
Release files / setuptools-proto-1.0.0.tar.gz
| Download URL | setuptools-proto-1.0.0.tar.gz |
|---|---|
| Size | 14.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a7f6839c186fcc53e6d19806971acb6c6c244eecf61d8d24edd2a39af05dd6ae
|
|
BLAKE2b-256 checksum How to use checksums |
1c693fcf0cfa9027be92b4cc4f0c27a9c2847d156844c6f84ab4a1f550c659da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10
|
Release files / setuptools_proto-1.0.0-py3-none-any.whl
| Download URL | setuptools_proto-1.0.0-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
75623e2c45f120262a814a9a841da363ae6574d544c925886cc05da611bae53d
|
|
BLAKE2b-256 checksum How to use checksums |
1020f1e0082973939e590e5d98162098ed1a1d97c5815fc7fa6167ed89fa7c28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10
|
Security for setuptools-proto 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.