Skip to content
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

Add python message generation #355

Closed
wants to merge 2 commits into from
Closed

Conversation

azeey
Copy link
Contributor

@azeey azeey commented Jun 27, 2023

🎉 New feature

Summary

Uses the new message generation framework to generate protobuf python files. This will be used by gazebosim/gz-transport#411. Since we won't be concerned with ABI issues for python files, I think it would be okay to provide binary distributions for the generated files.

Test it

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

Signed-off-by: Addisu Z. Taddese <[email protected]>
@codecov
Copy link

codecov bot commented Jun 27, 2023

Codecov Report

Merging #355 (62844f1) into main (16de9ef) will not change coverage.
The diff coverage is n/a.

❗ Current head 62844f1 differs from pull request most recent head 5e87462. Consider uploading reports for the commit 5e87462 to get more accurate results

@@           Coverage Diff           @@
##             main     #355   +/-   ##
=======================================
  Coverage   96.89%   96.89%           
=======================================
  Files          28       28           
  Lines        1064     1064           
=======================================
  Hits         1031     1031           
  Misses         33       33           

Comment on lines +5 to +18
# GENERATE_PYTHON - generates python code for the message if specified
# One value arguments:
# MSGS_GEN_SCRIPT - Path to the message generation python script
# PROTO_PACKAGE - Protobuf package the file belongs to (e.g. "gz.msgs")
# PROTOC_EXEC - Path to protoc
# GZ_PROTOC_PLUGIN - Path to the gazebo-specific protobuf compiler executable
# INPUT_PROTO - Path to the input .proto file
# OUTPUT_CPP_DIR - Path where C++ files are saved
# OUTPUT_PYTHON_DIR - Path where Python files are saved
# OUTPUT_INCLUDES - A CMake variable name containing a list that the C++ header path should be appended to
# OUTPUT_CPP_HH_VAR - A CMake variable name containing a list generated headers should be appended to
# OUTPUT_DETAIL_CPP_HH_VAR - A CMake variable name containing a list that the C++ detail headers should be appended to
# OUTPUT_CPP_CC_VAR - A Cmake variable name containing a list that the C++ source files should be appended to
# OUTPUT_PYTHON_VAR - A Cmake variable name containing a list that the python file should be appended to
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# GENERATE_PYTHON - generates python code for the message if specified
# One value arguments:
# MSGS_GEN_SCRIPT - Path to the message generation python script
# PROTO_PACKAGE - Protobuf package the file belongs to (e.g. "gz.msgs")
# PROTOC_EXEC - Path to protoc
# GZ_PROTOC_PLUGIN - Path to the gazebo-specific protobuf compiler executable
# INPUT_PROTO - Path to the input .proto file
# OUTPUT_CPP_DIR - Path where C++ files are saved
# OUTPUT_PYTHON_DIR - Path where Python files are saved
# OUTPUT_INCLUDES - A CMake variable name containing a list that the C++ header path should be appended to
# OUTPUT_CPP_HH_VAR - A CMake variable name containing a list generated headers should be appended to
# OUTPUT_DETAIL_CPP_HH_VAR - A CMake variable name containing a list that the C++ detail headers should be appended to
# OUTPUT_CPP_CC_VAR - A Cmake variable name containing a list that the C++ source files should be appended to
# OUTPUT_PYTHON_VAR - A Cmake variable name containing a list that the python file should be appended to
# GENERATE_PYTHON - generates python code for the message if specified
# One value arguments:
# MSGS_GEN_SCRIPT - Path to the message generation python script
# PROTO_PACKAGE - Protobuf package the file belongs to (e.g. "gz.msgs")
# PROTOC_EXEC - Path to protoc
# GZ_PROTOC_PLUGIN - Path to the gazebo-specific protobuf compiler executable
# INPUT_PROTO - Path to the input .proto file
# OUTPUT_CPP_DIR - Path where C++ files are saved
# OUTPUT_PYTHON_DIR - Path where Python files are saved
# OUTPUT_INCLUDES - A CMake variable name containing a list that the C++ header path should be appended to
# OUTPUT_CPP_HH_VAR - A CMake variable name containing a list generated headers should be appended to
# OUTPUT_DETAIL_CPP_HH_VAR - A CMake variable name containing a list that the C++ detail headers should be appended to
# OUTPUT_CPP_CC_VAR - A Cmake variable name containing a list that the C++ source files should be appended to
# OUTPUT_PYTHON_VAR - A Cmake variable name containing a list that the python file should be appended to

@@ -0,0 +1,32 @@
# Copyright (C) 2022 Open Source Robotics Foundation
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Copyright (C) 2022 Open Source Robotics Foundation
# Copyright (C) 2023 Open Source Robotics Foundation

@azeey azeey mentioned this pull request Jul 14, 2023
9 tasks
@azeey
Copy link
Contributor Author

azeey commented Jul 26, 2023

Closing since #362 is sufficient.

@azeey azeey closed this Jul 26, 2023
@azeey azeey deleted the python_gen branch July 26, 2023 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎵 harmonic Gazebo Harmonic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants