Skip to content

Setup native parsing boilerplate#285

Merged
keejon merged 4 commits into
mainfrom
native-parsing-boilerplate
Apr 24, 2026
Merged

Setup native parsing boilerplate#285
keejon merged 4 commits into
mainfrom
native-parsing-boilerplate

Conversation

@aiven-anton

@aiven-anton aiven-anton commented Apr 21, 2026

Copy link
Copy Markdown
Collaborator

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.

@codecov-commenter

codecov-commenter commented Apr 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.52%. Comparing base (d6e05b6) to head (d659111).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aiven-anton aiven-anton force-pushed the native-parsing-boilerplate branch 2 times, most recently from 0b8370e to f1aa03b Compare April 21, 2026 12:30
@aiven-anton aiven-anton marked this pull request as ready for review April 21, 2026 12:42
@aiven-anton aiven-anton requested a review from a team as a code owner April 21, 2026 12:42
Copilot AI review requested due to automatic review settings April 21, 2026 12:42
@aiven-anton aiven-anton requested a review from a team as a code owner April 21, 2026 12:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 maturin via a custom build_kio.py wrapper 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.

Comment thread Makefile
Comment thread MANIFEST.in
Comment thread build_kio.py Outdated
Comment thread pyproject.toml Outdated
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.
@aiven-anton aiven-anton force-pushed the native-parsing-boilerplate branch from f1aa03b to d659111 Compare April 21, 2026 14:02

@keejon keejon left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM 👍

@keejon keejon added this pull request to the merge queue Apr 24, 2026
Merged via the queue into main with commit d04fee2 Apr 24, 2026
21 checks passed
@keejon keejon deleted the native-parsing-boilerplate branch April 24, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants