Python Stack Guide
This guide covers using Sequant with Python projects.
Detection
Section titled “Detection”Sequant automatically detects Python projects by looking for:
pyproject.tomlsetup.pyrequirements.txt
Default Commands
Section titled “Default Commands”When initialized with the Python stack, Sequant configures these commands:
| Command | Default |
|---|---|
| Test | pytest |
| Build | python -m build |
| Lint | ruff check . |
| Format | ruff format . |
File Patterns
Section titled “File Patterns”The workflow skills use these patterns to locate files:
| Pattern | Glob |
|---|---|
| Source | src/**/*.py |
| Tests | tests/**/*.py |
Workflow Integration
Section titled “Workflow Integration”/spec Phase
Section titled “/spec Phase”During planning, Sequant will:
- Review package structure in
src/ - Check existing modules and classes
- Look for test patterns in
tests/
/exec Phase
Section titled “/exec Phase”During implementation, the agent will:
- Run
ruff check .for linting - Run
pytestfor test verification - Run
python -m buildto ensure packaging works
/qa Phase
Section titled “/qa Phase”Quality review includes:
- Ruff linting and formatting
- Type checking (if mypy/pyright configured)
- Test coverage review
- Docstring review
Customization
Section titled “Customization”Override commands in .claude/.local/memory/constitution.md:
## Build Commands
- Test: `pytest -v --cov=src`- Build: `poetry build`- Lint: `ruff check . && mypy src`Common Patterns
Section titled “Common Patterns”Modern Package (src layout)
Section titled “Modern Package (src layout)”pyproject.tomlsrc/└── mypackage/ ├── __init__.py ├── core.py └── utils.pytests/├── conftest.py├── test_core.py└── test_utils.pyPoetry Project
Section titled “Poetry Project”pyproject.toml # Poetry configurationpoetry.locksrc/└── mypackage/tests/Django Project
Section titled “Django Project”manage.pymyproject/├── settings.py├── urls.py└── wsgi.pyapps/├── users/└── api/-
Use
pyproject.toml- Modern Python projects should usepyproject.tomlfor configuration. -
Ruff - Sequant uses Ruff by default for fast linting and formatting. Configure in
pyproject.toml. -
Type Hints - Add type hints for better code quality; the agent will use them for understanding the codebase.
-
Virtual Environments - Ensure your venv is activated before running Sequant commands.