Skip to content

Commit 735e3cc

Browse files
committed
add protobuf 5 compatibility
1 parent a55df0b commit 735e3cc

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.github/workflows/tests.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
python-version: [3.8]
21-
environment: [py-proto4, py-tls-proto4, py-proto3, py-tls-proto3]
20+
python-version: [3.9]
21+
environment: [py-proto5, py-tls-proto5, py-proto4, py-tls-proto4, py-proto3, py-tls-proto3]
2222
folder: [ydb, tests]
2323
exclude:
24+
- environment: py-tls-proto5
25+
folder: ydb
2426
- environment: py-tls-proto4
2527
folder: ydb
2628
- environment: py-tls-proto3

ydb/_grpc/common/__init__.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,20 @@
3636
from ydb._grpc.v3 import protos # noqa
3737

3838
sys.modules["ydb._grpc.common.protos"] = sys.modules["ydb._grpc.v3.protos"]
39-
else:
39+
elif protobuf_version < Version("5.0"):
4040
from ydb._grpc.v4 import * # noqa
4141

4242
sys.modules["ydb._grpc.common"] = sys.modules["ydb._grpc.v4"]
4343

4444
from ydb._grpc.v4 import protos # noqa
4545

4646
sys.modules["ydb._grpc.common.protos"] = sys.modules["ydb._grpc.v4.protos"]
47+
48+
else:
49+
from ydb._grpc.v5 import * # noqa
50+
51+
sys.modules["ydb._grpc.common"] = sys.modules["ydb._grpc.v5"]
52+
53+
from ydb._grpc.v5 import protos # noqa
54+
55+
sys.modules["ydb._grpc.common.protos"] = sys.modules["ydb._grpc.v5.protos"]

0 commit comments

Comments
 (0)