Skip to content

Commit f2f869e

Browse files
authored
Merge pull request #385 from Enjection/feature/KIKIMR-20854/add-draft-protos-support-to-generator
Fix generate_protoc.py to support protos in draft dir
2 parents 60ec5f7 + a8f6e62 commit f2f869e

9 files changed

+10
-8
lines changed

generate_protoc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def remove_protos(rootdirpath: str):
4040
def fix_file_contents(rootdir, protobuf_version: str):
4141
flake_ignore_line = "# flake8: " + "noqa" # prevent ignore the file
4242
package_path = "ydb._grpc." + protobuf_version + ".protos"
43+
draft_package_path = "ydb._grpc." + protobuf_version + ".draft.protos"
4344

4445
for dirpath, _, fnames in os.walk(rootdir):
4546
for fname in fnames:
@@ -51,6 +52,7 @@ def fix_file_contents(rootdir, protobuf_version: str):
5152

5253
# Fix imports
5354
content = content.replace("from protos", "from " + package_path)
55+
content = content.replace("from draft.protos", "from " + draft_package_path)
5456

5557
# Add ignore style check
5658
content = content.replace("# -*- coding: utf-8 -*-", "# -*- coding: utf-8 -*-\n" + flake_ignore_line)

ydb/_grpc/v3/draft/ydb_dynamic_config_v1_pb2.py

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ydb/_grpc/v3/draft/ydb_dynamic_config_v1_pb2_grpc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"""Client and server classes corresponding to protobuf-defined services."""
33
import grpc
44

5-
from draft.protos import ydb_dynamic_config_pb2 as draft_dot_protos_dot_ydb__dynamic__config__pb2
5+
from ydb._grpc.v3.draft.protos import ydb_dynamic_config_pb2 as draft_dot_protos_dot_ydb__dynamic__config__pb2
66

77

88
class DynamicConfigServiceStub(object):

ydb/_grpc/v3/draft/ydb_maintenance_v1_pb2.py

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ydb/_grpc/v3/draft/ydb_maintenance_v1_pb2_grpc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"""Client and server classes corresponding to protobuf-defined services."""
33
import grpc
44

5-
from draft.protos import ydb_maintenance_pb2 as draft_dot_protos_dot_ydb__maintenance__pb2
5+
from ydb._grpc.v3.draft.protos import ydb_maintenance_pb2 as draft_dot_protos_dot_ydb__maintenance__pb2
66

77

88
class MaintenanceServiceStub(object):

ydb/_grpc/v4/draft/ydb_dynamic_config_v1_pb2.py

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ydb/_grpc/v4/draft/ydb_dynamic_config_v1_pb2_grpc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"""Client and server classes corresponding to protobuf-defined services."""
33
import grpc
44

5-
from draft.protos import ydb_dynamic_config_pb2 as draft_dot_protos_dot_ydb__dynamic__config__pb2
5+
from ydb._grpc.v4.draft.protos import ydb_dynamic_config_pb2 as draft_dot_protos_dot_ydb__dynamic__config__pb2
66

77

88
class DynamicConfigServiceStub(object):

ydb/_grpc/v4/draft/ydb_maintenance_v1_pb2.py

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ydb/_grpc/v4/draft/ydb_maintenance_v1_pb2_grpc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"""Client and server classes corresponding to protobuf-defined services."""
33
import grpc
44

5-
from draft.protos import ydb_maintenance_pb2 as draft_dot_protos_dot_ydb__maintenance__pb2
5+
from ydb._grpc.v4.draft.protos import ydb_maintenance_pb2 as draft_dot_protos_dot_ydb__maintenance__pb2
66

77

88
class MaintenanceServiceStub(object):

0 commit comments

Comments
 (0)