Using this small example you can reproduce the issue:
from clk.decorators import command, option
@command()
@option("-o", "--option", "o", multiple=True)
def working_cmd(o):
"""Calling this command with -o A -o B does not break"""
print(o)
from clk.decorators import flow_command
from clk.overloads import get_command
work = get_command("working-cmd")
@flow_command()
@work.flow_option("o")
def flow_bug(**options):
"""Calling this command with -o A -o B breaks"""
Calling working-cmd -o A -o B will work, while calling flow-bug -o A -o B will break
The issue seems to come from either clk.flow.get_flow_wrapper where the function clk.lib.flat_map is called with a generator of tuples as a parameter, or directly in the clk.lib.flat_map function that does not check if it content are lists.
A simple correction would be to replace the line elem = list(elem) by elem = list(map(list, elem)) but it could have effect elsewhere in the code base so I only put it as a proposition here.
Using this small example you can reproduce the issue:
Calling
working-cmd -o A -o B
will work, while callingflow-bug -o A -o B
will breakThe issue seems to come from either
clk.flow.get_flow_wrapper
where the functionclk.lib.flat_map
is called with a generator of tuples as a parameter, or directly in theclk.lib.flat_map
function that does not check if it content are lists.A simple correction would be to replace the line
elem = list(elem)
byelem = list(map(list, elem))
but it could have effect elsewhere in the code base so I only put it as a proposition here.