Skip to content

Add support for generating python proto code #110

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

Merged
merged 7 commits into from
Jan 21, 2025
Merged

Conversation

coolkp
Copy link
Contributor

@coolkp coolkp commented Dec 18, 2024

Changes in the following PR

  • Updated protoc version
  • Generate go code only has new protoc version
  • Update generate_go_protobuf -> generate_protobuf to add python code generation
  • Generated Python code
  • Package generated python code as pip package

@coolkp coolkp force-pushed the main branch 2 times, most recently from 3ca3253 to 5394619 Compare December 18, 2024 22:52
Signed-off-by: Kunjan Patel <kunjan@ucla.edu>
Signed-off-by: Kunjan Patel <kunjanp@google.com>
@coolkp coolkp marked this pull request as ready for review December 20, 2024 19:03
Copy link

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
In addition to the comments, a high-level question: are the __init__.py files auto generated? (I'm assume the bazel command adds these, but just want to make sure).

coolkp added 4 commits January 8, 2025 01:59
…e. Add disrtribution wheel

Signed-off-by: Kunjan Patel <kunjanp@google.com>
…e. Add disrtribution wheel

Signed-off-by: Kunjan Patel <kunjanp@google.com>
Signed-off-by: Kunjan Patel <kunjanp@google.com>
Signed-off-by: Kunjan Patel <kunjanp@google.com>
Copy link

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, overall LGTM.
Just a suggestion on how to refactor the function to support multi-languages.

Signed-off-by: Kunjan Patel <kunjanp@google.com>
Copy link

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
Overall LGTM, one comment about unifying requirements if possible.

input_dir = language_config.get_input_dir(bazel_bin, rule_dir)
input_files = glob.glob(os.path.join(input_dir, language_config.generated_file_pattern))
output_dir = os.path.join(output, rule_dir)
print(f"Moving {len(input_files)} generated files from {input_dir} to output_dir {output_dir}")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
print(f"Moving {len(input_files)} generated files from {input_dir} to output_dir {output_dir}")
print(f"Copying {len(input_files)} generated files from {input_dir} to output_dir {output_dir}")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why it got resolved.

Signed-off-by: Kunjan Patel <kunjanp@google.com>
Copy link

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to merge this to unblock you.
If there are other files that are not auto-generated, please remove them in a followup PR (and add them to the ignored list).

input_dir = language_config.get_input_dir(bazel_bin, rule_dir)
input_files = glob.glob(os.path.join(input_dir, language_config.generated_file_pattern))
output_dir = os.path.join(output, rule_dir)
print(f"Moving {len(input_files)} generated files from {input_dir} to output_dir {output_dir}")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why it got resolved.

@adisuissa adisuissa merged commit 2f00578 into cncf:main Jan 21, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants