File tree Expand file tree Collapse file tree 3 files changed +158
-0
lines changed Expand file tree Collapse file tree 3 files changed +158
-0
lines changed Original file line number Diff line number Diff line change @@ -76,3 +76,15 @@ To stop the build of the project after the first `n` failures use
76
76
$ pytask -x | --stop-after-first-failure # Stop after the first failure
77
77
$ pytask --max-failures 2 # Stop after the second failure
78
78
```
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
+ ```
Original file line number Diff line number Diff line change
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" )
You can’t perform that action at this time.
0 commit comments