Skip to content

Commit 3981577

Browse files
committed
switch from deprecatd distutil to packaging for detect protobuf package version
1 parent a547b56 commit 3981577

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

.github/workflows/tests.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Functional tests
22

33
on:
44
push:
5+
- master
56
pull_request:
67

78
jobs:

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ protobuf-4:
66
docker build -f generate-protobuf.Dockerfile . -t ydb-python-sdk-proto-generator-env-4
77
docker run --rm -it -v $${PWD}:$${PWD} -w $${PWD} ydb-python-sdk-proto-generator-env-4 python generate_protoc.py
88

9-
protobuf: protobuf-3 protobuf-4
9+
protobuf: protobuf-3 protobuf-4

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
grpcio==1.39.0
2+
packaging
23
protobuf>3.13.0,<5.0.0
34
pytest==6.2.4
45
aiohttp==3.7.4

ydb/_grpc/common/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import sys
22

33
import google.protobuf
4-
from distutils.version import LooseVersion
4+
from packaging.version import Version
55

66
# generated files are incompatible between 3 and 4 protobuf versions
77
# import right generated version for current protobuf lib
88
# sdk code must always import from ydb._grpc.common
9-
protobuf_version = LooseVersion(google.protobuf.__version__)
9+
protobuf_version = Version(google.protobuf.__version__)
1010

11-
if protobuf_version < LooseVersion("4.0"):
11+
if protobuf_version < Version("4.0"):
1212
from ydb._grpc.v3 import * # noqa
1313
from ydb._grpc.v3 import protos # noqa
1414
sys.modules["ydb._grpc.common"] = sys.modules["ydb._grpc.v3"]

0 commit comments

Comments
 (0)