Setup native parsing boilerplate#285
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #285 +/- ##
=======================================
Coverage 99.52% 99.52%
=======================================
Files 18 18
Lines 1253 1253
Branches 145 145
=======================================
Hits 1247 1247
Misses 3 3
Partials 3 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
0b8370e to
f1aa03b
Compare
There was a problem hiding this comment.
Pull request overview
Sets up the initial Rust/PyO3 “native parsing” extension scaffolding and switches packaging/CI to support building and linting the native module (split out from #273).
Changes:
- Add a Rust crate for
kio._kio_native(PyO3) and wire it into the repo. - Switch Python build backend to
maturinvia a custombuild_kio.pywrapper that injects setuptools-scm versioning. - Add Rust formatting/lint/test automation (CI + pre-commit) and developer cleanup targets.
Reviewed changes
Copilot reviewed 11 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/kio/static/primitive.py | Removes now-unneeded typing ignores for Hypothesis strategies. |
| src/kio/_kio_native.pyi | Adds stub file for the native module. |
| rust/src/lib.rs | Adds minimal PyO3 module entrypoint. |
| rust/rust-toolchain.toml | Pins Rust toolchain channel/components. |
| rust/Cargo.toml | Defines the native extension crate and PyO3 dependency. |
| rust/Cargo.lock | Locks Rust dependency graph for reproducible builds. |
| pyproject.toml | Switches build system to custom backend + maturin config and sets static version/readme. |
| build_kio.py | Implements backend wrapper to generate version via setuptools-scm and call maturin hooks. |
| docs/conf.py | Removes manual sys.path injection (docs build installs the package). |
| Makefile | Adds clean/nuke/build targets and globstar usage. |
| MANIFEST.in | Updates manifest excludes/includes for the new build setup. |
| .pre-commit-config.yaml | Adds local cargo fmt hook and updates mypy hook deps. |
| .gitignore | Ignores maturin debug artifacts. |
| .github/workflows/ci.yaml | Adds Rust lint/test job and installs Rust toolchain in Python test jobs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Replace setuptools with maturin to support building the Rust extension. Introduce build_kio.py to bridge maturin with setuptools-scm versioning. Add Makefile targets for building and cleaning, and pin the Rust toolchain.
Install and cache the Rust toolchain in all Python test jobs so the extension builds correctly. Add a dedicated rust-lint job running cargo fmt --check, cargo clippy -D warnings, and cargo test. Add a cargo fmt pre-commit hook for local enforcement.
f1aa03b to
d659111
Compare
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.
This PR isolates the boilerplate from #273, and puts all configuration in place to start compiling Rust and to ship that as a native extension. No code is implemented in Rust with this PR, that will come in follow-ups with further work from #273.