Taskfile.yaml•3.15 kB
version: '3'
tasks:
default:
desc: List available tasks
cmds:
- task --list
create-venv:
desc: Create a Python virtual environment in .venv
cmds:
- python3 -m venv .venv
sources: []
generates:
- .venv/bin/activate
activate-venv:
desc: Show how to activate the Python virtual environment
cmds:
- |
echo "To activate the virtual environment, run:"
echo " source .venv/bin/activate # for bash/zsh/fish on Unix/macOS"
echo " .venv\\Scripts\\activate # for Windows CMD"
echo " .venv\\Scripts\\Activate.ps1 # for Windows PowerShell"
clean-venv:
desc: Delete the .venv directory to clean the environment
cmds:
- rm -rf .venv
install-requirements:
desc: Upgrade pip and install requirements.txt using pip from the .venv
cmds:
- .venv/bin/python -m pip install --upgrade pip
- .venv/bin/python -m pip install -r requirements.txt
flake8:
desc: Run flake8 on ./src/ and ./tests/
cmds:
- .venv/bin/python -m flake8 src/ tests/
sources:
- src/**/*.py
- tests/**/*.py
mypy:
desc: Run mypy on ./src/ and ./tests/
cmds:
- .venv/bin/python -m mypy src/ tests/
sources:
- src/**/*.py
- tests/**/*.py
black:
desc: Run black on all *.py files
cmds:
- .venv/bin/python -m black .
sources:
- '**/*.py'
test:
desc: Run all tests (unit, integration, performance) with pytest and coverage
cmds:
- .venv/bin/python -m pytest
sources:
- src/**/*.py
- tests/**/*.py
test-unit:
desc: Run unit tests only
cmds:
- .venv/bin/python -m pytest tests/unit
test-integration:
desc: Run integration tests only
cmds:
- .venv/bin/python -m pytest tests/integration
test-performance:
desc: Run performance tests only
cmds:
- .venv/bin/python -m pytest tests/performance
coverage:
desc: Generate coverage report (HTML and term) using pytest-cov
cmds:
- .venv/bin/python -m pytest --cov=src --cov-report=term-missing --cov-report=html
lint:
desc: Run linters (flake8 and mypy)
deps:
- flake8
- mypy
format:
desc: Format code using black
deps:
- black
check:
desc: Run all checks (format, lint, type-check, and tests)
deps:
- format
- lint
- test
run:
desc: Run the console-based MCP server
cmds:
- .venv/bin/python -m my_mcp_server
dev:
desc: Alias for 'run' (start server for development)
deps:
- run
install-dev:
desc: Install project in editable mode with dev dependencies
cmds:
- .venv/bin/python -m pip install --upgrade pip
- .venv/bin/python -m pip install -e ".[dev]"
clean:
desc: Clean Python build artifacts and cache
cmds:
- find . -type f -name '*.py[co]' -delete
- find . -type d -name '__pycache__' -exec rm -rf {} +
- rm -rf build/ dist/ *.egg-info
build:
desc: Build distribution packages (wheel and sdist) using hatchling
cmds:
- .venv/bin/python -m hatchling build