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

--[WIP][Bugfix]- Address remaining issues with bindings stubgen #2432

Merged
merged 5 commits into from
Aug 15, 2024

Conversation

jturner65
Copy link
Contributor

@jturner65 jturner65 commented Jul 21, 2024

Motivation and Context

This PR fixes some issues that were missed in the previous PR, which manifest when pybind11 stubs are being generated (see here ).

Until all such issues are fixed, adding pybind11-stubgen to the build process will generate a stub file that will fail mypy precommit. In other words, no python source code changes or additions will be able to be committed to the repo with the erroneous stub file.

  • Cannot have argument names in a method that are python reserved words.
  • Same applies for enums. All enums should be all caps in python, so that's an essential refactor that needs to happen which would obviate this issue.
  • All types accessed by the bindings, either as args or return values, need to have pybind equivalents defined or else the generated stub file will have ellipses in the typing statements that cause syntax errors when mypy is executed.

Also, some missed spelling errors are corrected.

How Has This Been Tested

Locally tests pass; also testing with mypy execution on a modified python file.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@jturner65 jturner65 requested a review from aclegg3 July 21, 2024 15:13
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jul 21, 2024
@jturner65 jturner65 requested a review from 0mdc July 21, 2024 15:13
@jturner65 jturner65 force-pushed the Bindings2_Fixes branch 2 times, most recently from de33659 to 9edf16e Compare July 25, 2024 15:26
@jturner65 jturner65 marked this pull request as ready for review August 13, 2024 20:39
Copy link
Contributor

@0mdc 0mdc left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you!

@jturner65 jturner65 merged commit 518ed0e into main Aug 15, 2024
10 checks passed
@jturner65 jturner65 deleted the Bindings2_Fixes branch August 15, 2024 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants