Skip to content

feat(python): add direct VFS convenience methods#1295

Merged
chaliy merged 1 commit intomainfrom
fix/issue-1257-python-vfs-methods
Apr 14, 2026
Merged

feat(python): add direct VFS convenience methods#1295
chaliy merged 1 commit intomainfrom
fix/issue-1257-python-vfs-methods

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Apr 14, 2026

Summary

Add direct text-oriented VFS convenience methods to the Python Bash and BashTool APIs so callers no longer need to go through fs() for common operations.

Closes #1257.

What Changed

  • add read_file, write_file, append_file, mkdir, exists, remove, stat, chmod, symlink, read_link, read_dir, ls, and glob to both Python bindings
  • reuse shared live-FS helpers so Bash and BashTool stay behaviorally aligned
  • expose the new methods in _bashkit.pyi
  • add regression coverage for happy paths, shell-state interaction, reset behavior, UTF-8 errors, and glob safety
  • document the new convenience API in the Python README and specs/013-python-package.md

Verification

  • python -m pytest crates/bashkit-python/tests/test_bashkit.py -q
  • python -m pytest crates/bashkit-python/tests/test_bashkit.py -k 'direct_vfs_methods' -q
  • uvx ruff check crates/bashkit-python
  • uvx ruff format --check crates/bashkit-python
  • smoke test via installed package: direct BashTool mkdir/write_file/append_file/read_file/ls/glob
  • cargo clippy --all-targets --all-features -- -D warnings

Local Environment Notes

  • cargo test --all-features currently fails on this machine in unrelated core tests: fs::realfs::tests::resolve_fallback_returns_normalized_path, fs::realfs::tests::resolve_fallback_validates_containment, and logging_impl::tests::test_script_formatting
  • just pre-pr hit a local linker disk-space failure (errno=28) while building a test binary on a nearly full macOS volume

@chaliy chaliy merged commit c212744 into main Apr 14, 2026
18 checks passed
@chaliy chaliy deleted the fix/issue-1257-python-vfs-methods branch April 14, 2026 20:57
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.

feat(python): add direct VFS convenience methods on Bash/BashTool

1 participant