|
| 1 | +The configuration |
| 2 | +================= |
| 3 | + |
| 4 | +This document lists all options to configure pytask via the configuration files. |
| 5 | + |
| 6 | + |
| 7 | +The basics |
| 8 | +---------- |
| 9 | + |
| 10 | +To learn about the basics visit the :doc:`tutorial |
| 11 | +<../tutorials/how_to_configure_pytask>`. |
| 12 | + |
| 13 | + |
| 14 | +Truthy and falsy values |
| 15 | +----------------------- |
| 16 | + |
| 17 | +For some of the configuration values you need truthy or falsy values. pytask recognizes |
| 18 | +the following values. |
| 19 | + |
| 20 | +- truthy: ``True``, ``true``, ``1``. |
| 21 | +- falsy: ``False``, ``false``, ``0``. |
| 22 | + |
| 23 | +Additionally, the following values are interpreted as None which is neither truthy or |
| 24 | +falsy. |
| 25 | + |
| 26 | +- ``None`` |
| 27 | +- ``none`` |
| 28 | + |
| 29 | + |
| 30 | +The options |
| 31 | +----------- |
| 32 | + |
| 33 | +.. confval:: ignore |
| 34 | + |
| 35 | + pytask can ignore files and directories and exclude some tasks or reduce the |
| 36 | + duration of the collection. |
| 37 | + |
| 38 | + To ignore some file/folder via the command line, use the ``--ignore`` flag multiple |
| 39 | + times. |
| 40 | + |
| 41 | + .. code-block:: console |
| 42 | +
|
| 43 | + $ pytask --ignore some_file.py --ignore some_directory/* |
| 44 | +
|
| 45 | + Or, use the configuration file: |
| 46 | + |
| 47 | + .. code-block:: ini |
| 48 | +
|
| 49 | + # For single entries only. |
| 50 | + ignore = some_file.py |
| 51 | +
|
| 52 | + # Or single and multiple entries. |
| 53 | + ignore = |
| 54 | + some_directory/* |
| 55 | + some_file.py |
| 56 | +
|
| 57 | +
|
| 58 | +.. confval:: markers |
| 59 | + |
| 60 | + pytask uses markers to attach additional information to task functions. To see which |
| 61 | + markers are available, type |
| 62 | + |
| 63 | + .. code-block:: console |
| 64 | +
|
| 65 | + $ pytask markers |
| 66 | +
|
| 67 | + on the command-line interface. |
| 68 | + |
| 69 | + If you use a marker which has not been configured, you will get a warning. To |
| 70 | + silence the warning and document the marker, provide the following information in |
| 71 | + your pytask configuration file. |
| 72 | + |
| 73 | + .. code-block:: ini |
| 74 | +
|
| 75 | + markers = |
| 76 | + wip: Work-in-progress. These are tasks which I am currently working on. |
| 77 | +
|
| 78 | +
|
| 79 | +.. confval:: paths |
| 80 | + |
| 81 | + If you want to collect tasks from specific paths without passing the names via the |
| 82 | + command line, you can add the paths to the configuration file. Paths passed via the |
| 83 | + command line will overwrite the configuration value. |
| 84 | + |
| 85 | + .. code-block:: ini |
| 86 | +
|
| 87 | + # For single entries only. |
| 88 | + paths = src |
| 89 | +
|
| 90 | + # Or single and multiple entries. |
| 91 | + paths = |
| 92 | + folder_1 |
| 93 | + folder_2/task_2.py |
| 94 | +
|
| 95 | +
|
| 96 | +.. confval:: pdb |
| 97 | + |
| 98 | + If you want to enter the interactive debugger whenever an error occurs, pass the |
| 99 | + flag to the command line interface |
| 100 | + |
| 101 | + .. code-block:: console |
| 102 | +
|
| 103 | + pytask --pdb |
| 104 | +
|
| 105 | + or use a truthy configuration value. |
| 106 | + |
| 107 | + .. code-block:: ini |
| 108 | +
|
| 109 | + pdb = True |
| 110 | +
|
| 111 | +
|
| 112 | +.. confval:: strict_markers |
| 113 | + |
| 114 | + If you want to raise an error for unregistered markers, pass |
| 115 | + |
| 116 | + .. code-block:: console |
| 117 | +
|
| 118 | + pytask --strict-markers |
| 119 | +
|
| 120 | + or set the option to a truthy value. |
| 121 | + |
| 122 | + .. code-block:: ini |
| 123 | +
|
| 124 | + strict_markers = True |
| 125 | +
|
| 126 | +
|
| 127 | +.. confval:: trace |
| 128 | + |
| 129 | + If you want to enter the interactive debugger in the beginning of each task, use |
| 130 | + |
| 131 | + .. code-block:: console |
| 132 | +
|
| 133 | + pytask --trace |
| 134 | +
|
| 135 | + or set this option to a truthy value. |
| 136 | + |
| 137 | + .. code-block:: ini |
| 138 | +
|
| 139 | + trace = True |
0 commit comments