wrknv Task Reference¶
Complete reference for all standard tasks provided by the wrknv.python.tmpl template.
Quick Reference¶
# List all tasks
we tasks
# Run a task
we <task>
we run <task>
# Task information
we run <task> --info
# Dry run (show what would execute)
we run <task> --dry-run
Task Categories¶
- Testing - Run tests with various configurations
- Code Quality - Linting, formatting, type checking
- Documentation - Build, serve, validate docs
- Link Checking - Validate documentation links
- Mutation Testing - Advanced test quality analysis
- Build & Package - Build distributions, manage dependencies
- Development Shortcuts - Common dev workflows
- CI/CD Pipelines - Complete CI workflows
Testing¶
we test¶
Alias: we run test
Run all tests using pytest.
Subtasks:
we test parallel¶
Run tests in parallel using pytest-xdist.
Equivalent to: uv run pytest -n auto
we test verbose¶
Run tests with verbose output.
Equivalent to: uv run pytest -vvv
we test unit¶
Run only unit tests (requires pytest markers).
Equivalent to: uv run pytest -m unit
we test integration¶
Run only integration tests (requires pytest markers).
Equivalent to: uv run pytest -m integration
Coverage¶
we test coverage¶
Alias: we run test.coverage
Run tests with coverage report (HTML + terminal).
Coverage report is generated in htmlcov/ directory.
we test coverage xml¶
Run tests with XML coverage output (for CI).
Generates coverage.xml for CI systems.
Code Quality¶
Linting¶
we lint¶
Run ruff linter to check code quality.
Equivalent to: uv run ruff check .
we lint fix¶
Run linter with auto-fix enabled.
Fixes automatically fixable issues.
Formatting¶
we format¶
Format code using ruff formatter.
Modifies files in-place.
we format check¶
Check code formatting without modifying files.
Returns non-zero exit code if formatting needed.
Type Checking¶
we typecheck¶
Run mypy type checker on source code.
Equivalent to: uv run mypy src/
Quality Checks¶
we quality¶
Run all quality checks (lint + typecheck).
Composite task that runs:
1. lint - Code linting
2. typecheck - Type checking
we quality all¶
Run all quality checks including tests.
Composite task that runs:
1. format.check - Check formatting
2. lint - Code linting
3. typecheck - Type checking
4. test - Run tests
Documentation¶
we docs¶
Alias: we docs serve
Serve documentation locally (default action).
we docs setup¶
Extract base MkDocs configuration from provide-foundry.
Extracts to .provide/foundry/:
- base-mkdocs.yml
- Theme assets
- Documentation partials
- Generation scripts
we docs build¶
Build documentation site.
Builds to site/ directory.
we docs serve¶
Serve documentation locally with auto-reload.
Typically serves on http://127.0.0.1:8000/
we docs clean¶
Remove documentation build artifacts.
Removes site/ and .provide/ directories.
Link Checking¶
we docs links¶
Alias: we docs links check
Check internal documentation links (fast).
Uses lychee to validate:
- ./docs/**/*.md
- ./src/**/*.md
- ./README.md
- ./.github/**/*.md
- ./CONTRIBUTING.md
Performance: <1 second for internal links
we docs links local¶
Same as we docs links check - check internal links only.
Runs offline mode (no external URL checking).
we docs links external¶
Check all links including external URLs.
Performance: 2-5 minutes depending on network
Note: Requires lychee to be installed:
Mutation Testing¶
Mutation testing validates the quality of your tests by introducing bugs and checking if tests catch them.
we mutation¶
Run mutation testing with mutmut.
Equivalent to: uv run mutmut run
Subtasks¶
we mutation results¶
Show mutation testing results summary.
we mutation browse¶
Open interactive mutation browser (web UI).
we mutation clean¶
Clean mutation testing artifacts.
Removes .mutmut-cache and html/ directories.
Build & Package¶
we build¶
Build package distributions.
Creates wheel and sdist in dist/ directory.
Equivalent to: uv build
Package Management¶
we pkg install¶
Install package in development/editable mode.
Equivalent to: uv pip install -e .
we pkg uninstall¶
Uninstall package.
Auto-detects package name from pyproject.toml.
we pkg lock¶
Update dependency lock file.
Equivalent to: uv lock
we pkg version¶
Show package version.
Reads from VERSION file or pyproject.toml.
Development Shortcuts¶
Quick commands for common development tasks.
we dev setup¶
Initialize development environment.
Equivalent to: uv sync
we dev test¶
Quick test run (parallel mode).
Equivalent to: we test parallel
we dev check¶
Quick quality check (format + lint + typecheck).
Runs code formatting, linting, and type checking in sequence.
CI/CD Pipelines¶
Composite tasks for complete CI workflows.
we ci¶
Complete CI pipeline (quality + test + build).
Runs in sequence:
1. quality - All quality checks
2. test - Run tests
3. build - Build package
we ci test¶
CI testing pipeline with coverage.
Runs:
1. test.parallel - Parallel test execution
2. test.coverage - Coverage reporting
we ci quality¶
CI quality checks pipeline.
Runs:
1. format.check - Verify formatting
2. lint - Code linting
3. typecheck - Type checking
Clean¶
we clean¶
Remove all build artifacts and caches.
Removes:
- build/, dist/, *.egg-info
- .pytest_cache, .mypy_cache, .ruff_cache
- .hypothesis, htmlcov/, .coverage
- .mutmut-cache, site/
- All __pycache__ directories
- All .pyc and .pyo files
Setup¶
we setup¶
Initialize development environment.
Equivalent to: uv sync
we setup pre_commit¶
Install pre-commit hooks.
Installs: 1. pre-commit tool (if not installed) 2. Standard pre-commit config from ci-tooling 3. Git hooks for commit and commit-msg
Task Composition¶
Tasks can be combined in your project-specific wrknv.toml:
# Create custom composite tasks
[tasks.all-checks]
run = ["format", "lint", "typecheck", "test"]
description = "Run all checks sequentially"
[tasks.quick]
run = ["format", "lint", "test.fast"]
description = "Quick validation for rapid iteration"
Environment Variables¶
Tasks can use environment variables:
[tasks.test.integration]
run = "uv run pytest tests/integration/"
env = { DATABASE_URL = "postgresql://localhost/test" }
timeout = 300.0
Task Timeouts¶
Set timeouts for long-running tasks:
Working Directories¶
Specify working directory for tasks:
Related Documentation¶
- Deploying wrknv Tasks - How to deploy these tasks
- Link Checking Guide - Link validation details
- wrknv Documentation - Full wrknv user guide
Customizing Tasks¶
Projects can customize or extend standard tasks in their wrknv.toml:
# Override standard task
[tasks.test]
_default = "uv run pytest -v --tb=short"
# Add project-specific task
[tasks.benchmark]
run = "uv run pytest benchmarks/ --benchmark-only"
description = "Run performance benchmarks"
# Extend standard task category
[tasks.docs.pdf]
run = "mkdocs build && pandoc site/index.html -o docs.pdf"
description = "Generate PDF documentation"
Custom tasks are preserved when extracting template updates.