| 1 |
.. meta:: |
| 2 |
:description: Frequently Asked Questions on doit design and usage |
| 3 |
:keywords: python, doit, faq |
| 4 |
|
| 5 |
.. title:: FAQ - Frequently Asked Questions on doit design and usage |
| 6 |
|
| 7 |
|
| 8 |
======= |
| 9 |
FAQ |
| 10 |
======= |
| 11 |
|
| 12 |
|
| 13 |
Why is `doit` written in all lowercase instead of CamelCase? |
| 14 |
------------------------------------------------------------- |
| 15 |
|
| 16 |
At first it would be written in CamelCase `DoIt` but depending on the font |
| 17 |
some people would read it as `dolt <http://en.wiktionary.org/wiki/dolt#Noun>`_ |
| 18 |
with an `L` instead of `I`. So I just set it as lowercase to avoid confusion. |
| 19 |
|
| 20 |
|
| 21 |
*doit* is too verbose, why don't you use decorators? |
| 22 |
----------------------------------------------------- |
| 23 |
|
| 24 |
`doit` is designed to be extensible. |
| 25 |
A simple dictionary is actually the most flexible representation. |
| 26 |
It is possible to create different interfaces on top of it. |
| 27 |
Check this `blog post <http://blog.schettino72.net/posts/doit-task-creation.html>`_ |
| 28 |
for some examples. |
| 29 |
|
| 30 |
|
| 31 |
`dodo.py` file itself should be a `file_dep` for all tasks |
| 32 |
----------------------------------------------------------- |
| 33 |
|
| 34 |
If I edit my `dodo.py` file and re-run *doit*, |
| 35 |
and my tasks are otherwise up-to-date, the modified tasks are not re-run. |
| 36 |
|
| 37 |
While developing your tasks it is recommended |
| 38 |
to use ``doit forget`` after you change your tasks |
| 39 |
or use ``doit --always-run``. |
| 40 |
|
| 41 |
In case you really want, you will need to explicitly |
| 42 |
add the `dodo.py` in `file_dep` of your tasks manually. |
| 43 |
|
| 44 |
If `dodo.py` was an implicit `file_dep`: |
| 45 |
|
| 46 |
* how would you disable it? |
| 47 |
* should imported files from your `dodo.py` also be a `file_dep`? |
| 48 |
|
| 49 |
|
| 50 |
Why `file_dep` can not depend on a directory/folder? |
| 51 |
------------------------------------------------------ |
| 52 |
|
| 53 |
A `file_dep` is considered to not be up-to-date when the content of |
| 54 |
the file changes. But what is a folder change? |
| 55 |
Some people expect it to be a change in any of its containing files |
| 56 |
(for this case see question below). |
| 57 |
Others expect it to be whether the folder exist or not, |
| 58 |
or if a new file was added or removed from the folder (for these |
| 59 |
cases you should implement a custom ``uptodate`` |
| 60 |
(:ref:`check the API<uptodate_api>`). |
| 61 |
|
| 62 |
|
| 63 |
How to make a dependency on all files in a folder? |
| 64 |
---------------------------------------------------- |
| 65 |
|
| 66 |
``file_dep`` does NOT support folders. |
| 67 |
If you want to specify all files from a folder you can use a third |
| 68 |
party library like `pathlib <https://pypi.python.org/pypi/pathlib>`_ ( |
| 69 |
`pathlib` was add on python's 3.4 stdlib). |