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 I want to have different versions of this task. A naive way of doing this would be the following.
# dodo1.py
name = 'Tim'
def task_hello():
return {
'actions': [f'echo Hello {name}!']
}
And
# dodo2.py
name = 'Julia'
def task_hello():
return {
'actions': [f'echo Hello {name}!']
}
I do want multiple dodo
modules. However, I do not want to copy the task definition.
Note that, although I have mentioned just one task here for simplicity, I have a set of inter-dependent tasks and subtasks. Also, I do not want to use command line parameters and prefer to have multiple config
files.