Questions tagged [doit]
25 questions
2
votes
1 answer
python doit - how to echo the shell commands executed?
The action of my task is a shell command. Is there an option in doit to display the actual shell command executed?
The reason I want this feature is that the shell command is dynamically created by python expression, so I want to see the actual…

victorx
- 3,267
- 2
- 25
- 35
2
votes
1 answer
Python doit: Create subtasks using file generated from previous task
With Python doit I want to generate sub-tasks by reading a list of files from a file (that was generated in an earlier task), then yielding actions for each of those files:
def task_generates_list_of_files():
def generate_file():
with…

Harry
- 3,312
- 4
- 34
- 39
1
vote
0 answers
How to reference a task in another task's actions in doit?
I wish I could do something like this:
def task_1():
return {"actions": ["echo b"]}
def task_2():
return {"actions": ["echo a", "task_1", "echo c"]}
In the documentation, I can find about Python actions where you reference an action (but…

Bite code
- 578,959
- 113
- 301
- 329
1
vote
1 answer
how to get pydoit to run all cmd-action tasks even if some have non-zero exit status?
I would like to run all tasks even if some have non-zero exit status. I can do this with doit --continue from the command line, but would like to embed the directive in the dodo.py file itself. I've checked the docs but have been unable to find a…

Greg Wilson
- 1,015
- 10
- 24
1
vote
2 answers
Python doit: subtask yields same uptodate callable
I have this code in dodo.py:
def closed_over(par):
print("\n??? " + par)
if par == "bar":
return False
else:
return True
def task_bug():
for par in ("foo", "bar"):
print("par: " + par)
# closure!
…

Andrea Richiardi
- 703
- 6
- 21
1
vote
1 answer
PyDoIt: Sharing tasks definitions across modules
Here is a simpler version of the problem I am facing. I have a task in dodo.py file. This task has access to a module level variable name.
# dodo.py
name = 'John'
def task_hello():
return {
'actions': [f'echo Hello {name}!']
}
Now…

dips
- 1,627
- 14
- 25
1
vote
1 answer
How to make a list of the user-created python files that a module depends on?
I am interested in using doit to automate the build process of a python package.
If possible, I would like doit to re-execute a task if any of the user-created source files it depends on have changed.
From my understanding, the best way to…

Roy Smart
- 664
- 4
- 12
0
votes
0 answers
How to load 'doit' configurtion from pyproject.toml when using 'doit' API
I'm trying to embed 'doit' in my application and so instead of using 'doit' the CLI way, I am looking at the API way.
However, when doing so, I'm unable to figure out how to have 'doit' load the 'pyproject.toml'.
from Globals import * # part of…

yogmk
- 161
- 10
0
votes
0 answers
JSONDecodeError Issue when running doit tests
This is what I am running with doit.
def task_tests() -> dict:
"""Runs all tests."""
return {
"actions": ["poetry run pytest"],
}
and When I run it I get this error
doit tests
Traceback (most recent call last):
File…

Sazzad
- 773
- 11
- 22
0
votes
2 answers
doit command color output issue
I am using doit tool for build.
Currently the issue I am facing is related to color output meaning when I call doit the output will start with color but end up without color.
However, when I run call it second time I will get colored output at the…

Sujan Shah
- 1
- 2
0
votes
1 answer
Python doit module: How to choose which shell to run task actions?
I am using python doit module as a GNU make replacement.
Seems that doit is running actions on /bin/sh:
pedro@Gen83-ubuntu:~$ echo $SHELL
/bin/bash
pedro@Gen83-ubuntu:~$ doit merge_phased
. phase_dataset:15
/bin/sh: 1: [[: not found
TaskError -…

Pedro Inácio
- 105
- 5
0
votes
1 answer
Python doit dynamic actions
I am using Python doit and would like to dynamically generate actions. The following code creates a list of commands that I would like doit to execute:
dirs = ['a','b','c']
def task_build():
def create_cmd_string(directories=dirs):
…

Joshua Stewart
- 15
- 2
0
votes
1 answer
How to remove command line buffering
I am launching a tool through a doit task that can optionally be driven interactively. In conjunction with this I'm running with '--verbosity 2' in order to enable this tool's command line to be sent to STDOUT. The issue is the command line is…

bgrace
- 1
0
votes
1 answer
How do you debug pydoit?
I have a python doit script that is getting stuck on one step but doesn't throw an error. It would sit all day if I let it. I've checked all the inputs and they look exactly the same as the last time I ran it. How do I debug? I tried using pdb…

Celeste Wilson
- 45
- 9
0
votes
1 answer
SymPy: no effect of doit on a product of exponentials
I am trying to get an exponential of a sum from the product of exponentials using SymPy. It seems to work for any base, but e (Euler number).
Example of code with a generic base for the exponential:
from sympy import symbols, Function
from sympy…

Fabrizio
- 91
- 1
- 6