Repository navigation
Add draft stub generation and Action typing - #507
Draft
james-d-mitchell wants to merge 1 commit into
Draft
james-d-mitchell wants to merge 1 commit into
james-d-mitchell wants to merge 1 commit into
Conversation
Generate stubs from runtime bindings, source annotations, and documented signatures. Require an explicit module, print to stdout by default, and select public native classes plus typing dependencies for extension targets. Add sample Action and BMat8 helper stubs, bind Action's element and point types to the class, and accept CxxWrapper subclasses in copy_cxx_mem_fns. AI disclosure: OpenAI Codex helped prepare the implementation, tests, documentation, commit message, and PR description, and ran validation. Assisted-by: Codex <codex@openai.com> Co-authored-by: Codex <codex@openai.com>
Member
Author
|
This is a partial attempt (or start of an attempt) to resolve #476 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dynamic wrapper methods and native bindings lose useful type information during ordinary stub generation. This adds a reusable generator that combines pybind11-stubgen discovery with source annotations, generic bases, and documented signatures.
--output-dir; replacing existing files requires--force.--no-public-onlyrequests the full extension, and--strictstops on backend diagnostics.copy_cxx_mem_fnsclass annotation.Generated stubs remain drafts: some native signatures still need manual correction. The mypy tests cover Action and an isolated BMat8 section, not the complete native stub. This does not add a
py.typedmarker.Validation:
uv run --offline --no-sync --with pybind11-stubgen==2.5.5 --with mypy==2.3.1 pytest tests/test_generate_stubs.py tests/test_action.py tests/test_bmat8.py -k 'not test_action_transf': 58 passed, 1 deselected. The excluded test enumerates a large transformation action.AI disclosure: OpenAI Codex helped prepare the implementation, tests, documentation, commit message, and this PR description, and ran validation. The commit includes
Assisted-by: Codex <codex@openai.com>andCo-authored-by: Codex <codex@openai.com>trailers.