Skip to content

ci(python): add Python bindings CI with ruff and pytest#212

Merged
chaliy merged 4 commits intomainfrom
claude/python-bindings-ci-giVmy
Feb 18, 2026
Merged

ci(python): add Python bindings CI with ruff and pytest#212
chaliy merged 4 commits intomainfrom
claude/python-bindings-ci-giVmy

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Feb 18, 2026

Summary

  • Add .github/workflows/python.yml — CI for Python bindings on PRs/pushes to main
    • lint: ruff check + format via astral-sh/setup-uv (fast, no Rust build)
    • test: maturin develop + pytest across Python 3.9, 3.12, 3.13
    • build-wheel: maturin build + twine check, uploads artifact
    • python-check: gate job for branch protection
    • Path-filtered to crates/bashkit-python/, crates/bashkit/, Cargo.toml/lock
  • Add crates/bashkit-python/tests/test_bashkit.py — 20 pytest cases covering construction, sync/async exec, state persistence, ExecResult, reset, LLM metadata, langchain spec
  • Add ruff config to pyproject.toml (py39, line-length 120, rules E/F/W/I/UP)
  • Fix all existing ruff issues: unused imports, Optional[X]X | None, Typetype, line-length
  • Update AGENTS.md: Python section, pre-PR checklist step 14
  • Update spec 013: tests in layout, CI/Linting sections, local dev commands
  • Add just python-lint recipe

Test plan

  • python.yml lint job passes (ruff check + format)
  • python.yml test jobs pass on Python 3.9, 3.12, 3.13
  • python.yml build-wheel job produces valid wheel
  • Existing Rust CI unaffected

Add .github/workflows/python.yml that runs on PRs touching Python
bindings or core crate. Tests across Python 3.9/3.12/3.13 via maturin
develop + pytest. Separate build-wheel job verifies packaging with
twine check. Gate job (Python Check) for branch protection.

Add crates/bashkit-python/tests/test_bashkit.py covering:
- BashTool construction (default + custom params)
- Sync and async execution
- State persistence (variables, files)
- ExecResult properties, to_dict, repr, str
- Reset behavior
- LLM metadata methods (description, help, schemas)
- create_langchain_tool_spec

https://claude.ai/code/session_019xLsk6rbRNC9GWEiEGfZna
Add ruff config to pyproject.toml (target py39, line-length 120,
rules E/F/W/I/UP). Add lint job to python.yml using uvx ruff via
astral-sh/setup-uv. Fix all existing lint issues: unused imports,
Optional[X] -> X | None, Type -> type, line-length violations.
Reformat all Python files.

https://claude.ai/code/session_019xLsk6rbRNC9GWEiEGfZna
- AGENTS.md: add Python section (ruff, pytest, CI), add step 14 to
  pre-PR checklist for ruff on Python changes
- specs/013-python-package.md: add tests/ to layout, add CI and
  Linting sections, update Local Development with ruff/pytest commands
- justfile: add python-lint recipe

https://claude.ai/code/session_019xLsk6rbRNC9GWEiEGfZna
maturin develop requires a virtualenv which isn't present in the
GitHub Actions runner. Switch to build wheel + pip install approach
matching publish-python.yml pattern.

https://claude.ai/code/session_019xLsk6rbRNC9GWEiEGfZna
@chaliy chaliy merged commit b5f5f21 into main Feb 18, 2026
15 checks passed
@chaliy chaliy deleted the claude/python-bindings-ci-giVmy branch February 18, 2026 00:27
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.

2 participants