You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the above example, I need to create an explicit namespace ns and manually add each task to the constructor. Once the explicit namespace is defined, then it can be configured.
Is it possible to simply configure the implicit/default namespace instead and avoid having to create an explicit namespace?
For example, in a quick test this seems to work, but I'm wondering if there are any downsides/foot-guns to this approach:
@task
def task1(c):
pass
@task
def task2(c):
pass
ns = Collection.from_module(sys.modules[__name__]) # no need to add tasks manually
ns.configure({'key': 'value'})
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is there a way to add configuration to the implicit/default root namespace?
For example, let's say I've got the following
tasks.py
:In the above example, I need to create an explicit namespace
ns
and manually add each task to the constructor. Once the explicit namespace is defined, then it can be configured.Is it possible to simply configure the implicit/default namespace instead and avoid having to create an explicit namespace?
For example, in a quick test this seems to work, but I'm wondering if there are any downsides/foot-guns to this approach:
Beta Was this translation helpful? Give feedback.
All reactions