Skip to main content

A python project task runner

Project description

gear

werr

werr version license python

A simple, opinionated, python project task runner.

werr passing

A task is a configured sequence of commands to run.

[project]
name = "appletree"
version = "0.1.0"
dependencies = [
    "pysunlight==24.1",
]

[tool.werr]
# 'check' is the default task if `werr` is run with no arguments.
task.check = [
    "black --check {project}",
    "isort --check {project}",
    "ruff check {project}",
    "mypy {project}",
    "pytest",
]
task.fix = [
    "black {project}",
    "isort {project}",
    "ruff fix {project}",
]

Running werr executes each check command in sequence, printing which failed and how. The tool returns a non-zero exit code if any command fails.

Running werr fix executes each fix command in sequence.

NOTE: All commands are run using uv (the only dependency of this project).

Command Variables

The following {...} variables are provided by werr to be used in task commands:

  • {project} - the absolute path to the directory containing the pyproject.toml file

Structured Output

werr         # interactive human readable output (default)
werr --json  # emit lines of JSON representing the result of each command
werr --xml   # print Junit XML for CI

The --json output results in a line of JSON being emitted as soon as a command finishes:

> werr --json | jq
{
  "task": "black",
  "command": "black --check {project}/werrlib",
  "duration": 0.10738483420573175,
  "output": "All done! ✨ 🍰 ✨\n8 files would be left unchanged.\n",
  "success": true
}
{
  "task": "ruff",
  "command": "ruff check {project}/werrlib",
  "duration": 0.016670041950419545,
  "output": "All checks passed!\n",
  "success": true
}
{
  "task": "ty",
  "command": "ty check {project}/werrlib",
  "duration": 0.03577654203400016,
  "output": "All checks passed!\n",
  "success": true
}
{
  "task": "pytest",
  "command": "pytest --config-file {project}/pyproject.toml",
  "duration": 0.13576683308929205,
  "output": "============================= test session starts ==============================\nplatform darwin -- Python 3.14.0rc1, pytest-9.0.2, pluggy-1.6.0\nrootdir: /Users/joe/repos/werr\nconfigfile: pyproject.toml\ntestpaths: tests\ncollected 7 items\n\ntests/test_config.py .......                                             [100%]\n\n============================== 7 passed in 0.01s ===============================\n",
  "success": true
}

Custom Tasks

Define a custom task with task.<name> = [ ... ]

[tool.werr]
# ...
task.docs = [
    "sphinx-build -b html {project}",
]

Running werr docs will build the documentation.

New Project

A suggested workflow for creating a new project is:

  1. uv init
  2. uv add --dev black ruff ty pytest
  3. add tasks to [tool.werr]
  4. uvx werr or add to dev group and in venv just werr

Failing Example

werr failing

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

werr-0.3.0.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

werr-0.3.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file werr-0.3.0.tar.gz.

File metadata

  • Download URL: werr-0.3.0.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.8

File hashes

Hashes for werr-0.3.0.tar.gz
Algorithm Hash digest
SHA256 bc05909a41bb91a0e5c79fea12344be26c2ff18e07526387b787527bac3ea830
MD5 0ab2cde880e8fd4aaf26ed1e6edf3c69
BLAKE2b-256 448c0b79c900e9516e7cec77dd030b25684dff8b185b2d018f255945be0cb944

See more details on using hashes here.

File details

Details for the file werr-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: werr-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.8

File hashes

Hashes for werr-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 450b09b9e7c7872e8fda9812ba6bb84c90ea0bb996dc62320f4f411ac4d0c7de
MD5 b082ef77d75cd3462cf9ffe17a60c996
BLAKE2b-256 65a249b1bf80ff3092e859ec383d01edfb1c4bcc85cd679c1d99b8af0e09126e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page