29344 cython stub generator
Hey @sshane, @jnewb1, @adeebshihadeh,
CythonPEG is a parser that was specifically developed for the automatic generation of Python stub files from Cython files. I forked it and implemented several changes and additions to enhance its usability and functionality. Below is the summary of its functionalities including both the original features and the ones that have been added or modified:
- Object definition,
- Expression definition,
- Class definitions,
- Function definitions,
- Struct definition,
- Enum definitions,
- Alias definition,
- Import statement definition,
- External declaration definition,
- Compiler directives definition,
- Docstring definition,
- Recursive definitions.
I've also implemented a script that utilizes this parser to generate stubs (.pyi) from Cython files (.pyx, .pxd). It has the capability to parse either all relevant Cython files within the openpilot repository or specific ones provided as arguments via the command line. I've also utilized the script to generate stubs and place each of them in a 'stubs' directory alongisde the original file. I'm looking forward to your feedback to ensure that this is something you wanted for this issue. Please let me know if there are any changes you would like me to make.
Thanks!
Thanks for contributing to openpilot! In order for us to review your PR as quickly as possible, check the following:
- Convert your PR to a draft unless it's ready to review
- Read the contributing docs
- Before marking as "ready for review", ensure:
- the goal is clearly stated in the description
- all the tests are passing
- the change is something we merge
- include a route or your device' dongle ID if relevant
Diff is unreadable here. Can you gitignore the generated code so I can read the diff?
Diff is unreadable here. Can you gitignore the generated code so I can read the diff?
Hey, I ignored .pyi files, as you requested. If you want to see how they look I can post them here.
Indent is still wrong. This PR has required more review than it appears to be worth.
Feel free to open a new one once it's cleaned up and ready to go.