Earlier today, I tried to make the DynamicMeta class more robust. We'll see how that works out for me.
Anyway, now I need to refresh my memory about what the command-line wrapper modules do, and what they should do, and figure out how to get between those states.
So, what I think I want is to have a very abstract interface, where the modules are ultimately defining functions that produce Dynamic[Command[Script, Any]] objects. (They can also have functions that produce intermediate values like Invocation[Module, Any].)
Basically, given a Dynamic[Command[Script, Any]], which potentially includes other Dynamic[Command[Script, Any]] objects, that can be fed into a utility function that I should probably move into invocation.py, that should be all we need to set up the argument to api.build().
Let's take a look at flake8.py. It has:
- A Program subclass
- A Label[Pip] for installing and running flake8
- A Command alias
- An Option alias
- Command and Option definitions
- Dynamic[Option] objects
Under the Invocation paradigms, those last two need their labels arguments broken out into a ValueAdaptor, and to be converted into AdaptiveDynamic instances. It requires an interesting collection of Parts to handle the HTML output, so I might need to mess around with that a bit. Basically, it's a situation where there's an Input Arg that needs to be created, and it'll have a predictable child as an Output Extra. What this says to me is that I should consider reworking FlexOut. Currently, when FlexOut has make_parent = True, it adds the parent to extra_io. So...
Would it work to convert this to some kind of callback that turns the parent input into a CmdMeta? Since there are some... issues potentially, with creating arbitrary CmdMeta objects, then my feeling is that I want to create some form of union of classes that implement the callbacks. I'm going to write this down for now, rather than mess with the code more.
There is more to evaluate in the other wrappers, but I'd like to wind down for now, so I'm done for tonight.