Skip to main content

do: Simple just- and xc-like task runner

Do is a simple task runner that does not include any AI antifeatures, and that is not known to be AI-vulnerable.

Like just, Do makes it easy to define simple recipes that can take arguments and depend on each other.

Like xc, Do pulls tasks from a specially formatted Markdown file, using code fences to define tasks.

Do is intended to run either as a standalone script, using PEP 723 metadata, or to be installable as a wheel. Thus, Do consists of a single file, do.py, that can be vendored into projects as necessary, or that can be depended on as a wheel.

License and AI Policy

This project is licensed under the MIT license. This license does not preclude you from using Do with AI-encumbered or AI-vulnerable projects, but you do not have the author's consent to do so. This may seem like a contradiction, but copyright is a blunt tool that does not in general have the humanistic nuance to describe something like "you can legally do this thing, but if you do, you're an asshole."

Any AI-generated contributions will result in an immediate block. Don't be that guy.

Running Do

There are several ways of running do itself, depending on your needs.

To run do as a Python package, ensure that do-runner is installed in your environment (typically by making it a development dependency in your pyproject.toml):

python -m do ...

To run do as a uv tool:

uvx do-runner

To run do from a copy vendored into a repo that uses Do:

./do.py ...

Finally, if Do is installed globally, you can run do directly as a command. For shell environments where do is a reserved keyword, the aliases do_ and go-do are also defined, such that the following invocations are all identical:

do --help
do_ --help
go-do --help

In the rest of this README, we'll use do to refer to whatever method you use to run do.

Using Do

By default, do pulls its list of tasks from a file called Do.md. This can be overriden by passing the --dofile argument to do:

do --dofile=other-do.md

When run without arguments, do will run the task name __default__ in the dofile; if there isn't one, it prints a list of valid tasks from the given dofile.

The main do command can be run with either the name of a single task, possibly followed by arguments to that task, or as a list of tasks.

For example, if test and build are distinct tasks in Do.md, then the following will run the test and build tasks in that order:

do test build

If run is a task that accepts arguments, then the following will run the run task with python -m do as its arguments:

do run python -m do

Defining Tasks

Tasks are represented by Markdown code blocks with additional metadata provided after the initial ticks.

For example, to declare a "run" task that depends on a second task called "build":

```task run: build
pdm run python -m main
```

Tasks can take variadic arguments, typically to wrap a system command so as to include common arguments:

```task pdm *args:
pdm --verbose {{args}}
```

Tasks can have arguments:

```task run $what: build
pdm run python -m {{what}}
```

Tasks can contain comments as lines starting with #. Tasks can run other tasks manually using ! notation:

```task pdm *args:
pdm --verbose {{args}}
```
```task run $what: build
# Ensure that pdm always runs in verbose mode.
!pdm run python -m {{what}}
```

Visible Signature Lines

Most Markdown renderers do not show the information that comes after the initial fence for a code block; this can make it more difficult to see the structure of tasks when rendering Do.md.

Thus, do also allows placing the signature on the next line. That is, the following two task declarations are equivalent:

```task foo $arg: bar
cc $arg
```

```task
foo $arg: bar
cc $arg
```

Changelog

  • 0.1.6
    • Group log outputs by task when run in CI.
    • Look for __default__ tasks when no explicit tasks are specified at the command line. Thanks, @gwync@mastodon.coffee!
    • Print a list of tasks when an invalid task is given at the command line. Thanks, @gwync@mastodon.coffee!
  • 0.1.5
    • Fix issue with splitting multiple explicit arguments.
  • 0.1.4
    • Allow searching parent directories for Do.md.
    • Allow searching __etc__ for Do.md.
    • Improved terminal output when listing targets.
  • 0.1.3
    • Added error code handling, split execution logic into Doer and Planner classes.
  • 0.1.2
    • Added next-line style task signatures.

Metadata

Release files for do-runner 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for do-runner 0.1.6
File Size Uploaded Provenance Actions
do_runner-0.1.6.tar.gz 10.2 kB Without provenance Details for do_runner-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for do-runner 0.1.6
File Interpreter ABI Platform Actions
do_runner-0.1.6-py3-none-any.whl Python 3 none any Details for do_runner-0.1.6-py3-none-any.whl

Total release size: 19.9 kB

Release files / do_runner-0.1.6.tar.gz

Download URL do_runner-0.1.6.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b25cba2cc3dfb452b6bba2838e9935fe9afcaef7fb76ad1a2ffd2d1c8c30c04a
BLAKE2b-256 checksum
How to use checksums
7a543cd5d77054536e2f911a949c79fe683764fa67631b955c3ba2f4515532df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.29.7 CPython/3.15.1 Linux/7.0.0-38-generic

Release files / do_runner-0.1.6-py3-none-any.whl

Download URL do_runner-0.1.6-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6fd2a9deaf18c09cf530744449e4bb3fc8afb7e70915c11f2e6340832b1539eb
BLAKE2b-256 checksum
How to use checksums
cce1e29fddbc8d664bb02aa000f2b8a7463263f949bc7b122f010b05a75b21f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.29.7 CPython/3.15.1 Linux/7.0.0-38-generic

Security for do-runner 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page