TrB proto — Python
Сгенерированные protobuf/gRPC stubs для Python-сервисов TrB.
Установка
pip install trb-proto
Зафиксировать версию (как в Docker-сервисе indicators):
pip install trb-proto==1.0.34
Пакет публикуется на PyPI при релизе (make rel).
Пример: gRPC-клиент
import grpc
from indicators import indicators_pb2 as pb
from indicators import indicators_pb2_grpc
channel = grpc.insecure_channel("localhost:9093")
stub = indicators_pb2_grpc.IndicatorsStub(channel)
supported = stub.ListSupported(pb.ListSupportedRequest())
print([i.name for i in supported.indicators])
Пример: gRPC-сервер
from concurrent import futures
import grpc
from indicators import indicators_pb2_grpc
class IndicatorsServicer(indicators_pb2_grpc.IndicatorsServicer):
...
server = grpc.server(futures.ThreadPoolExecutor(max_workers=4))
indicators_pb2_grpc.add_IndicatorsServicer_to_server(IndicatorsServicer(), server)
server.add_insecure_port("[::]:9093")
server.start()
server.wait_for_termination()
Docker (TrB_backend)
ARG TRB_PROTO_VERSION=1.0.34
RUN pip install "trb-proto==${TRB_PROTO_VERSION}"
В .env:
TRB_PROTO_VERSION=1.0.34
TRB_PROTO_SOURCE=pypi
До первой публикации на PyPI: TRB_PROTO_SOURCE=git (установка из GitHub-тега).
Локальная разработка
# editable install из соседнего репозитория
pip install -e ../TrB_proto
# после изменения proto
cd TrB_proto && make gene
Trusted Publisher (PyPI)
Pending publisher до первого релиза, если проекта ещё нет:
| Поле | Значение |
|---|---|
| PyPI project name | trb-proto |
| Owner | Mar1eena |
| Repository | TrB_proto |
| Workflow name | release.yml |
| Environment name | (пусто) |
GitHub Actions workflow: .github/workflows/release.yml, action pypa/gh-action-pypi-publish@v1.14.2.
Зависимости пакета
protobuf>=4.25.0grpcio>=1.60.0
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 trb_proto-1.0.43.tar.gz.
File metadata
- Download URL: trb_proto-1.0.43.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec5302f84bd365a452f25d670e73275400e907db31f71c80b2b75a7a31ce61c6
|
|
| MD5 |
65510eb48add9b3e340d974bb34d7568
|
|
| BLAKE2b-256 |
457f463764b5df310e385945c8d30ab47cb47b97bafabbcb627a7cf38ebaca64
|
Provenance
The following attestation bundles were made for trb_proto-1.0.43.tar.gz:
Publisher:
release.yml on Mar1eena/TrB_proto
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trb_proto-1.0.43.tar.gz -
Subject digest:
ec5302f84bd365a452f25d670e73275400e907db31f71c80b2b75a7a31ce61c6 - Sigstore transparency entry: 2655278586
- Sigstore integration time:
-
Permalink:
Mar1eena/TrB_proto@cf6b7909cec22a292606e20758d837d9e4f5b715 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Mar1eena
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cf6b7909cec22a292606e20758d837d9e4f5b715 -
Trigger Event:
push
-
Statement type:
File details
Details for the file trb_proto-1.0.43-py3-none-any.whl.
File metadata
- Download URL: trb_proto-1.0.43-py3-none-any.whl
- Upload date:
- Size: 15.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab97ec7ef6204dcd875024907a0dc71f2dc6d1b469284d46d3542944480339ae
|
|
| MD5 |
c1423c48c145b77e6f26de92ebe85038
|
|
| BLAKE2b-256 |
cef7fa4fe2554acbd15cc124fbd82b86772aeb8edd75202b26faba52344ba938
|
Provenance
The following attestation bundles were made for trb_proto-1.0.43-py3-none-any.whl:
Publisher:
release.yml on Mar1eena/TrB_proto
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trb_proto-1.0.43-py3-none-any.whl -
Subject digest:
ab97ec7ef6204dcd875024907a0dc71f2dc6d1b469284d46d3542944480339ae - Sigstore transparency entry: 2655278599
- Sigstore integration time:
-
Permalink:
Mar1eena/TrB_proto@cf6b7909cec22a292606e20758d837d9e4f5b715 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Mar1eena
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cf6b7909cec22a292606e20758d837d9e4f5b715 -
Trigger Event:
push
-
Statement type: