-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update protobuf to include instance_id #1881
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1881 +/- ##
==========================================
- Coverage 90.54% 90.52% -0.02%
==========================================
Files 126 126
Lines 19481 19483 +2
==========================================
- Hits 17639 17637 -2
- Misses 1842 1846 +4
|
protoc_command = " ".join(("protoc", *FILES, f"--python_out={PROTO_DIR}", f"--pyi_out={PROTO_DIR}")) | ||
subprocess.run(shlex.split(protoc_command), check=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a bit weird to me first join the command parameters, and then split it again using shlex.
diff --git a/scripts/update_proto_files.py b/scripts/update_proto_files.py
index 2ce4e724..c65f4422 100644
--- a/scripts/update_proto_files.py
+++ b/scripts/update_proto_files.py
@@ -20,7 +20,7 @@ from pathlib import Path
import requests
URL_BASE = "https://raw.githubusercontent.com/cognitedata/protobuf-files/master/v1/timeseries/"
-FILES = "data_point_list_response.proto", "data_points.proto", "data_point_insertion_request.proto"
+FILES = ["data_point_list_response.proto", "data_points.proto", "data_point_insertion_request.proto"]
PROTO_DIR = str(Path("cognite/client/_proto").resolve())
@@ -30,8 +30,8 @@ def download_proto_files_and_compile():
for file in map(Path, FILES):
file.touch()
file.write_bytes(requests.get(f"{URL_BASE}{file}").content)
- protoc_command = " ".join(("protoc", *FILES, f"--python_out={PROTO_DIR}", f"--pyi_out={PROTO_DIR}"))
- subprocess.run(shlex.split(protoc_command), check=True)
+ protoc_command = ["protoc"] + FILES + [f"--python_out={PROTO_DIR}", f"--pyi_out={PROTO_DIR}"]
+ subprocess.run(protoc_command, check=True)
def patch_bad_imports():
But this is just a nit.
Description
Updates proto files and also adds the one for insert request (for future possible implementation)
DM-2030