Skip to content

Python Stack Guide

This guide covers using Sequant with Python projects.

Sequant automatically detects Python projects by looking for:

  • pyproject.toml
  • setup.py
  • requirements.txt

When initialized with the Python stack, Sequant configures these commands:

CommandDefault
Testpytest
Buildpython -m build
Lintruff check .
Formatruff format .

The workflow skills use these patterns to locate files:

PatternGlob
Sourcesrc/**/*.py
Teststests/**/*.py

During planning, Sequant will:

  • Review package structure in src/
  • Check existing modules and classes
  • Look for test patterns in tests/

During implementation, the agent will:

  • Run ruff check . for linting
  • Run pytest for test verification
  • Run python -m build to ensure packaging works

Quality review includes:

  • Ruff linting and formatting
  • Type checking (if mypy/pyright configured)
  • Test coverage review
  • Docstring review

Override commands in .claude/.local/memory/constitution.md:

## Build Commands
- Test: `pytest -v --cov=src`
- Build: `poetry build`
- Lint: `ruff check . && mypy src`
pyproject.toml
src/
└── mypackage/
├── __init__.py
├── core.py
└── utils.py
tests/
├── conftest.py
├── test_core.py
└── test_utils.py
pyproject.toml # Poetry configuration
poetry.lock
src/
└── mypackage/
tests/
manage.py
myproject/
├── settings.py
├── urls.py
└── wsgi.py
apps/
├── users/
└── api/
  1. Use pyproject.toml - Modern Python projects should use pyproject.toml for configuration.

  2. Ruff - Sequant uses Ruff by default for fast linting and formatting. Configure in pyproject.toml.

  3. Type Hints - Add type hints for better code quality; the agent will use them for understanding the codebase.

  4. Virtual Environments - Ensure your venv is activated before running Sequant commands.