Skip to content

Commit a5e7393

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

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

.github/workflows/tests.yaml

Lines changed: 1 addition & 0 deletions
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:

requirements.txt

Lines changed: 1 addition & 0 deletions
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

Lines changed: 3 additions & 3 deletions
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)