1
1
# The configuration
2
2
3
- This document lists all options to configure pytask via the configuration files .
3
+ This document lists all options to configure pytask with a ` pyproject.toml ` file .
4
4
5
5
## The basics
6
6
7
7
To learn about the basics visit the {doc}` tutorial <../tutorials/configuration> ` .
8
8
9
- ## Truthy and falsy values
9
+ Examples for the TOML specification be found [ here] ( https://toml.io/en/ ) or in [ PEP
10
+ 518] ( https://peps.python.org/pep-0518/ ) .
10
11
11
- For some of the configuration values you need truthy or falsy values. pytask recognizes
12
- the following values.
13
-
14
- - truthy: ` True ` , ` true ` , ` 1 ` .
15
- - falsy: ` False ` , ` false ` , ` 0 ` .
16
-
17
- Additionally, the following values are interpreted as None which is neither truthy or
18
- falsy.
19
-
20
- - ` None `
21
- - ` none `
12
+ The configuration values are set under the ` [tool.pytask.ini_options] ` section to mimic
13
+ the old ini configurations and to allow pytask leveraging the full potential of the TOML
14
+ format in the future.
22
15
23
16
## The options
24
17
34
27
If you have very strong reasons for relying on this inaccuracy, although, it is
35
28
strongly discouraged, you can deactivate the warning in the configuration file with
36
29
37
- .. code-block:: ini
30
+ .. code-block:: toml
38
31
39
32
check_casing_of_paths = false
40
33
@@ -52,31 +45,31 @@ falsy.
52
45
the modules in which tasks are defined. By default, following the link will open the
53
46
module with your default application. It is done with
54
47
55
- .. code-block:: ini
48
+ .. code-block:: toml
56
49
57
- editor_url_scheme = file
50
+ editor_url_scheme = " file"
58
51
59
52
If you use ``vscode`` or ``pycharm`` instead, the file will be opened in the
60
53
specified editor and the cursor will also jump to the corresponding line.
61
54
62
- .. code-block:: ini
55
+ .. code-block:: toml
63
56
64
- editor_url_scheme = vscode | pycharm
57
+ editor_url_scheme = " vscode" | " pycharm"
65
58
66
59
For complete flexibility, you can also enter a custom url which can use the
67
60
variables ``path`` and ``line_number`` to open the file.
68
61
69
- .. code-block:: ini
62
+ .. code-block:: toml
70
63
71
- editor_url_scheme = editor://{path}:{line_number}
64
+ editor_url_scheme = " editor://{path}:{line_number}"
72
65
73
66
Maybe you want to contribute this URL scheme to make it available to more people.
74
67
75
68
To disable links, use
76
69
77
- .. code-block:: ini
70
+ .. code-block:: toml
78
71
79
- editor_url_scheme = no_link
72
+ editor_url_scheme = " no_link"
80
73
81
74
```
82
75
@@ -95,15 +88,13 @@ falsy.
95
88
96
89
Or, use the configuration file:
97
90
98
- .. code-block:: ini
91
+ .. code-block:: toml
99
92
100
93
# For single entries only.
101
- ignore = some_file.py
94
+ ignore = " some_file.py"
102
95
103
96
# Or single and multiple entries.
104
- ignore =
105
- some_directory/*
106
- some_file.py
97
+ ignore = ["some_directory/*", "some_file.py"]
107
98
108
99
```
109
100
@@ -123,10 +114,10 @@ falsy.
123
114
silence the warning and document the marker, provide the following information in
124
115
your pytask configuration file.
125
116
126
- .. code-block:: ini
117
+ .. code-block:: toml
127
118
128
- markers =
129
- wip: Work-in-progress. These are tasks which I am currently working on.
119
+ [tool.pytask.ini_options. markers]
120
+ wip = " Work-in-progress. These are tasks which I am currently working on."
130
121
131
122
```
132
123
@@ -143,9 +134,9 @@ falsy.
143
134
144
135
and in the configuration use
145
136
146
- .. code-block:: ini
137
+ .. code-block:: toml
147
138
148
- n_entries_in_table = all # default 15
139
+ n_entries_in_table = " all" # default 15
149
140
150
141
```
151
142
@@ -156,15 +147,13 @@ falsy.
156
147
command line, you can add the paths to the configuration file. Paths passed via the
157
148
command line will overwrite the configuration value.
158
149
159
- .. code-block:: ini
150
+ .. code-block:: toml
160
151
161
152
# For single entries only.
162
- paths = src
153
+ paths = " src"
163
154
164
155
# Or single and multiple entries.
165
- paths =
166
- folder_1
167
- folder_2/task_2.py
156
+ paths = ["folder_1", "folder_2/task_2.py"]
168
157
169
158
```
170
159
@@ -180,9 +169,9 @@ falsy.
180
169
181
170
or use a truthy configuration value.
182
171
183
- .. code-block:: ini
172
+ .. code-block:: toml
184
173
185
- pdb = True
174
+ pdb = true
186
175
187
176
```
188
177
@@ -196,9 +185,9 @@ falsy.
196
185
197
186
pytask build --show-errors-immediately
198
187
199
- .. code-block:: ini
188
+ .. code-block:: toml
200
189
201
- show_errors_immediately = True
190
+ show_errors_immediately = true
202
191
203
192
```
204
193
@@ -212,9 +201,9 @@ falsy.
212
201
213
202
pytask build --show-locals
214
203
215
- .. code-block:: ini
204
+ .. code-block:: toml
216
205
217
- show_locals = True
206
+ show_locals = true
218
207
219
208
```
220
209
@@ -229,9 +218,9 @@ falsy.
229
218
230
219
or set the option to a truthy value.
231
220
232
- .. code-block:: ini
221
+ .. code-block:: toml
233
222
234
- strict_markers = True
223
+ strict_markers = true
235
224
236
225
```
237
226
@@ -240,13 +229,11 @@ falsy.
240
229
241
230
Change the pattern which identify task files.
242
231
243
- .. code-block:: ini
232
+ .. code-block:: toml
244
233
245
- task_files = task_*.py # default
234
+ task_files = " task_*.py" # default
246
235
247
- task_files =
248
- task_*.py
249
- tasks_*.py
236
+ task_files = ["task_*.py", "tasks_*.py"]
250
237
251
238
```
252
239
@@ -261,7 +248,7 @@ falsy.
261
248
262
249
or set this option to a truthy value.
263
250
264
- .. code-block:: ini
251
+ .. code-block:: toml
265
252
266
- trace = True
253
+ trace = true
267
254
```
0 commit comments