|
| 1 | +# python_template Agent Documentation |
| 2 | + |
| 3 | +## Project Overview |
| 4 | +This project uses **pixi** for environment management. Configuration and tasks are defined in `pyproject.toml`. |
| 5 | + |
| 6 | +## Development Workflow |
| 7 | + |
| 8 | +**Making Changes:** |
| 9 | +- Implement the requested modifications |
| 10 | +- Run `pixi run style` to format and lint the code |
| 11 | +- Run `pixi run test` to verify tests pass |
| 12 | +- Execute `pixi run ci` and iterate until all checks pass |
| 13 | +- Commit only when CI passes |
| 14 | + |
| 15 | +## Available Pixi Tasks |
| 16 | + |
| 17 | +### Formatting and Linting |
| 18 | +- `pixi run format` - Format code using ruff |
| 19 | +- `pixi run ruff-lint` - Lint and auto-fix code issues with ruff |
| 20 | +- `pixi run pylint` - Run pylint checks on all Python files |
| 21 | +- `pixi run lint` - Run both ruff-lint and pylint |
| 22 | +- `pixi run style` - Format and lint code (runs format + lint) |
| 23 | + |
| 24 | +### Testing |
| 25 | +- `pixi run test` - Run pytest tests |
| 26 | +- `pixi run coverage` - Run tests with coverage reporting |
| 27 | +- `pixi run coverage-report` - Display coverage report |
| 28 | + |
| 29 | +### CI Workflow |
| 30 | +- `pixi run ci` - Run complete CI pipeline (style + coverage + coverage-report) |
| 31 | + |
| 32 | +### Pre-commit Hooks |
| 33 | +- `pixi run pre-commit` - Run all pre-commit hooks |
| 34 | +- `pixi run pre-commit-update` - Update pre-commit hook versions |
| 35 | + |
| 36 | +### Utility Tasks |
| 37 | +- `pixi run update-lock` - Update pixi.lock file |
| 38 | +- `pixi run clear-pixi` - Remove .pixi directory and pixi.lock |
| 39 | +- `pixi run setup-git-merge-driver` - Configure git merge driver for lock files |
| 40 | +- `pixi run update-from-template-repo` - Update from the template repository |
| 41 | + |
| 42 | +## Python Environments |
| 43 | + |
| 44 | +The project supports multiple Python versions: |
| 45 | +- `default` - Default environment with latest supported Python |
| 46 | +- `py310` - Python 3.10 environment |
| 47 | +- `py311` - Python 3.11 environment |
| 48 | +- `py312` - Python 3.12 environment |
| 49 | +- `py313` - Python 3.13 environment |
| 50 | + |
| 51 | +To use a specific environment, add `-e <env>` to pixi commands: |
| 52 | +```bash |
| 53 | +pixi run -e py310 test |
| 54 | +``` |
| 55 | + |
| 56 | +## Best Practices |
| 57 | + |
| 58 | +1. **Always run CI before committing**: Use `pixi run ci` to ensure all checks pass |
| 59 | +2. **Keep dependencies updated**: Regularly run `pixi run update-lock` |
| 60 | +3. **Use pre-commit hooks**: Set up pre-commit hooks to catch issues early |
| 61 | +4. **Test across Python versions**: Verify compatibility by testing with different environments |
| 62 | +5. **Format before linting**: The `style` task runs format first, then lint |
0 commit comments