fix(python): remove stale _native extension from repo (#75)#83
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis pull request addresses stale PyO3 native extension binaries by adding Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
The compiled PyO3 extension `python/fbuild/_native.pyd` was checked into
the repo and went out of sync with `crates/fbuild-python/src/lib.rs`.
Running tests that import `fbuild._native` (e.g. `test_serial_reset.py`)
failed with AttributeError for symbols like `SerialMonitor.reset_device`
because the committed binary predated the Rust source.
- Remove the stale Windows binary so the working tree never ships a
pre-built extension.
- Gitignore `_native.{pyd,abi3.so,so,dylib}` under `python/fbuild/` so a
freshly-built artifact can never be accidentally committed again.
- Document the local build step in the top-level README and in
`python/README.md` / `python/fbuild/README.md`:
`uv run cargo build --release -p fbuild-python --features extension-module`
followed by copying the artifact into `python/fbuild/`.
Published PyPI wheels are unaffected: `ci/publish.py` already downloads
fresh per-platform extensions from the `build.yml` GitHub Actions run,
so the checked-in binary was only used for local in-tree Python tests.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1265b7c to
56036ac
Compare
Summary
python/fbuild/_native.pyd, a checked-in PyO3 extension that went stale againstcrates/fbuild-python/src/lib.rsand causedAttributeError: SerialMonitor.reset_devicewhen running Python tests that importfbuild._native.python/fbuild/_native.{pyd,abi3.so,so,dylib}to.gitignoreso a freshly-built artifact cannot be accidentally re-committed.python/README.md/python/fbuild/README.md:uv run cargo build --release -p fbuild-python --features extension-module # then copy target/release/_native.{dll,so,dylib} -> python/fbuild/_native.{pyd,abi3.so}Published PyPI wheels are unaffected —
ci/publish.pyalready pulls fresh per-platform extensions from thebuild.ymlGitHub Actions run. The committed binary was only ever used for local in-tree Python tests.Fixes #75.
Test plan
uv run cargo build --release -p fbuild-python --features extension-modulesucceedspython/fbuild/_native.pyd,from fbuild._native import SerialMonitorexposesreset_device(previously missing on the stale binary)git check-ignore python/fbuild/_native.pydmatches the new.gitignoreentrybuild.ymlstill produces_native.pyd/_native.abi3.soartifacts (workflow unchanged)./publishwheel assembly still finds the extensions (publish.py unchanged)Summary by CodeRabbit
Documentation
Chores