-
-
Notifications
You must be signed in to change notification settings - Fork 37
♻️ Auto-generate stub file #773
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
📝 WalkthroughSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughAdds stub generation and checking: CI enables stub checks, a nox Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer (push/PR)
participant GH as GitHub Actions
participant Linter as Reusable python-linter
participant Nox as nox ("stubs" session)
participant Stubgen as nanobind.stubgen
participant Ruff as ruff (format/check)
Dev->>GH: push / open PR
GH->>Linter: run `python-linter` job (check-stubs: true)
Linter->>Nox: invoke `nox -s stubs` (repo)
Nox->>Stubgen: run `nanobind.stubgen` -> generate `.pyi`
Stubgen-->>Nox: `.pyi` artifacts
Nox->>Ruff: run ruff-format / ruff-check on generated `.pyi`
Ruff-->>Linter: pass/fail result
Linter-->>GH: report job status
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@noxfile.py`:
- Around line 248-250: The session.run calls pass Path objects in pyi_files
which can cause issues for external commands; before calling session.run in the
block that invokes "prek" ("license-tools", "ruff-check", "ruff-format"), map
pyi_files to strings (e.g., [str(p) for p in pyi_files]) and use that list when
passing --files to session.run so all arguments are plain str values; update the
three session.run calls that reference pyi_files accordingly.
burgholzer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. Just some recommendations on adding a few missing docstrings.
burgholzer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Thanks!
Description
After we have switched from
pybind11tonanobindin #766, we can now auto-generate the stub file. This PR defines a correspondingnoxsession and copies over all existing docstrings to the bindings code.Checklist:
I have added appropriate tests that cover the new/changed functionality.I have updated the documentation to reflect these changes.I have added migration instructions to the upgrade guide (if needed).