feat(python): add snapshot restore support#1298
Merged
chaliy merged 2 commits intoeverruns:mainfrom Apr 15, 2026
Merged
Conversation
76e1f6b to
136de95
Compare
There was a problem hiding this comment.
Pull request overview
Adds snapshot/restore support to the Python bindings to match existing Node API parity, enabling serializing interpreter state and restoring it into the same or a new configured instance.
Changes:
- Add
snapshot(),restore_snapshot(), andfrom_snapshot()to PythonBashandBashToolbindings (PyO3). - Add pytest coverage for snapshot round-trip and reset→restore flows.
- Update Python type stubs and documentation/examples to describe the new API.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| specs/013-python-package.md | Documents snapshot/restore usage for BashTool and Bash. |
| crates/bashkit-python/tests/test_bashkit.py | Adds tests for Bash and BashTool snapshot/restore behavior and error handling (partially). |
| crates/bashkit-python/src/lib.rs | Implements snapshot/restore methods and shared helper functions in the PyO3 bindings. |
| crates/bashkit-python/examples/bash_basics.py | Adds an example demonstrating snapshot/restore usage. |
| crates/bashkit-python/bashkit/_bashkit.pyi | Updates stubs to include the new methods and signatures. |
| crates/bashkit-python/README.md | Adds a Snapshot/Restore section and updates the API method list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
510f34a to
9695837
Compare
Contributor
|
LGTM, @oliverlambson pls assign PR to me when you feel it ready for merge. |
Contributor
Author
|
@chaliy great! I don't have permissions to assign PRs on this repo, but I'm happy for you to self-assign & merge 👍 |
Contributor
|
Thank you! |
10 tasks
chaliy
added a commit
that referenced
this pull request
Apr 15, 2026
## Summary - bump workspace and JS package versions from 0.1.18 to 0.1.19 - add release notes for changes since v0.1.18, keeping external contribution credit for @oliverlambson in #1298 - update Cargo.lock to pull rustls-webpki 0.103.12 and clear the current cargo-audit blocker on main ## Verification - cargo fmt --check - cargo clippy --all-targets --all-features -- -D warnings - cargo audit --ignore RUSTSEC-2023-0071 - cargo deny check - cargo run -p bashkit-cli -- --version ## Notes - cargo test --all-features still hits the existing bash_comparison_tests parity mismatch set already present on main (114 mismatches), unchanged by this branch
chaliy
added a commit
that referenced
this pull request
Apr 15, 2026
## Summary - bump Bashkit release metadata from `0.1.18` to `0.1.19` - add the `0.1.19` changelog entry, including explicit external contribution credit for @oliverlambson in #1298 - update `Cargo.lock` to pull `rustls-webpki 0.103.12` so the current cargo-audit failure on `main` is cleared for this release ## Why - `main` is currently blocked from shipping because the Audit job fails on `RUSTSEC-2026-0098` and `RUSTSEC-2026-0099` in `rustls-webpki 0.103.10` - the release PR needs that dependency remediation or it inherits the same red CI state and cannot publish ## Verification - `cargo fmt --check` - `cargo clippy --all-targets --all-features -- -D warnings` - `cargo audit --ignore RUSTSEC-2023-0071` - `cargo deny check` - `cargo run -p bashkit-cli -- --version` ## Notes - `cargo test --all-features` still hits the existing `bash_comparison_tests` parity mismatch set already present on `main` (114 mismatches), unchanged by this branch
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.
Closes #1256
Summary
snapshot(),restore_snapshot(), andfrom_snapshot()to the PythonBashandBashToolbindingsTesting
cargo test -p bashkit-python --no-runcargo fmt --check.uv-venv-bashkit/bin/python -m pytest crates/bashkit-python/tests/test_bashkit.py.uv-venv-bashkit/bin/ruff check crates/bashkit-pythoncargo clippy -p bashkit-python --all-targets --no-deps -- -D warningsNotes
cargo clippy -p bashkit-python --all-targets -- -D warningsstill hits pre-existing dead-code warnings incrates/bashkitunrelated to this change