Skip to content

Commit

Permalink
fix generate_protoc.py to support protos in draft dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Enjection committed Jan 24, 2024
1 parent 60ec5f7 commit a8f6e62
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions generate_protoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def remove_protos(rootdirpath: str):
def fix_file_contents(rootdir, protobuf_version: str):
flake_ignore_line = "# flake8: " + "noqa" # prevent ignore the file
package_path = "ydb._grpc." + protobuf_version + ".protos"
draft_package_path = "ydb._grpc." + protobuf_version + ".draft.protos"

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

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

# Add ignore style check
content = content.replace("# -*- coding: utf-8 -*-", "# -*- coding: utf-8 -*-\n" + flake_ignore_line)
Expand Down
2 changes: 1 addition & 1 deletion ydb/_grpc/v3/draft/ydb_dynamic_config_v1_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ydb/_grpc/v3/draft/ydb_dynamic_config_v1_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from draft.protos import ydb_dynamic_config_pb2 as draft_dot_protos_dot_ydb__dynamic__config__pb2
from ydb._grpc.v3.draft.protos import ydb_dynamic_config_pb2 as draft_dot_protos_dot_ydb__dynamic__config__pb2


class DynamicConfigServiceStub(object):
Expand Down
2 changes: 1 addition & 1 deletion ydb/_grpc/v3/draft/ydb_maintenance_v1_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ydb/_grpc/v3/draft/ydb_maintenance_v1_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from draft.protos import ydb_maintenance_pb2 as draft_dot_protos_dot_ydb__maintenance__pb2
from ydb._grpc.v3.draft.protos import ydb_maintenance_pb2 as draft_dot_protos_dot_ydb__maintenance__pb2


class MaintenanceServiceStub(object):
Expand Down
2 changes: 1 addition & 1 deletion ydb/_grpc/v4/draft/ydb_dynamic_config_v1_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ydb/_grpc/v4/draft/ydb_dynamic_config_v1_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from draft.protos import ydb_dynamic_config_pb2 as draft_dot_protos_dot_ydb__dynamic__config__pb2
from ydb._grpc.v4.draft.protos import ydb_dynamic_config_pb2 as draft_dot_protos_dot_ydb__dynamic__config__pb2


class DynamicConfigServiceStub(object):
Expand Down
2 changes: 1 addition & 1 deletion ydb/_grpc/v4/draft/ydb_maintenance_v1_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ydb/_grpc/v4/draft/ydb_maintenance_v1_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from draft.protos import ydb_maintenance_pb2 as draft_dot_protos_dot_ydb__maintenance__pb2
from ydb._grpc.v4.draft.protos import ydb_maintenance_pb2 as draft_dot_protos_dot_ydb__maintenance__pb2


class MaintenanceServiceStub(object):
Expand Down

0 comments on commit a8f6e62

Please sign in to comment.