Skip to content

Commit 742dd93

Browse files
committed
Add an entry in the docs.
1 parent 6b2193a commit 742dd93

File tree

3 files changed

+158
-0
lines changed

3 files changed

+158
-0
lines changed
Lines changed: 132 additions & 0 deletions
Loading

docs/source/tutorials/invoking_pytask.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,15 @@ To stop the build of the project after the first `n` failures use
7676
$ pytask -x | --stop-after-first-failure # Stop after the first failure
7777
$ pytask --max-failures 2 # Stop after the second failure
7878
```
79+
80+
### Performing a dry-run
81+
82+
If you want to see which tasks would be executed without executing them, you can do a
83+
dry-run.
84+
85+
```console
86+
$ pytask --dry-run
87+
```
88+
89+
```{image} /_static/images/dry-run.svg
90+
```

scripts/svgs/task_dry_run.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from __future__ import annotations
2+
3+
import pytask
4+
5+
6+
@pytask.mark.produces("out.txt")
7+
def task_dry_run(produces):
8+
produces.write_text("This text file won't be produced in a dry-run.")
9+
10+
11+
if __name__ == "__main__":
12+
pytask.console.record = True
13+
pytask.main({"paths": __file__, "dry_run": True})
14+
pytask.console.save_svg("dry-run.svg", title="pytask")

0 commit comments

Comments
 (0)