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

[Python] Fix various codegen problems #8292

Merged
merged 2 commits into from May 1, 2024

Conversation

anton-bobukh
Copy link
Contributor

This includes:

  • escaping keywords happens after converting the case:
    • currently, table ClassT generate class = Class() which is invalid Python;
  • imports in one_file mode use the filename rather than the type name when resolving module names;
  • use filename_suffix instead of the hardcoded _generated one;
  • generate empty files if no structs or enums are available. This makes the set of output files more predictable for Bazel.

This includes:

-  escaping keywords happens **after** converting the case:
   - currently, `table ClassT` generate `class = Class()` which is invalid Python;
-  imports in `one_file` mode use the filename rather than the type name when resolving module names;
-  use `filename_suffix` instead of the hardcoded `_generated` one;
-  generate empty files if no structs or enums are available. This makes the set of output files more predictable for Bazel.
@github-actions github-actions bot added c++ codegen Involving generating code from schema python labels Apr 25, 2024
This includes:

-  escaping keywords happens **after** converting the case:
   - currently, `table ClassT` generate `class = Class()` which is invalid Python;
-  imports in `one_file` mode use the filename rather than the type name when resolving module names;
-  use `filename_suffix` instead of the hardcoded `_generated` one;
-  generate empty files if no structs or enums are available. This makes the set of output files more predictable for Bazel.
tests/FromInclude.py Show resolved Hide resolved
@dbaileychess dbaileychess merged commit c696275 into google:master May 1, 2024
45 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ codegen Involving generating code from schema python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants