Coding 2021-11-22

By Max Woerner Chase

Today, I ended up just trying to do more with MOTR. It was mainly focused on planning. I was figuring out what the functionality related to running tests under coverage would look like (there are some weird subtleties), and I think I'm going to need to work things out from the "how are environments created?" perspective.

So, first off, there's some awkward stuff going on that means that things aren't quite right, because I've got this idea that it should be possible to dispatch commands to things besides a Python virtualenv with all of this, but I don't know if it should be possible to run disparate installers for a single command. The data types support specifying the information, but right now the shape of the code forces a very specific flow that prevents actually using more than one binary directory. Thinking about this, I think the solution is to create a pair of (installer, command) objects, and allow that type anywhere in a CmdMeta. Then, after the installers run, the pairs can be processed into Input and Output. Actually, since the path can be pre-calculated, it would mean less changes to the rest of the stack if the Output data were calculated before the installers run, and injected into their commands.

I think this will help out the structure in general, even if I'm not currently taking advantage of the flexibility this provides. (It allows my to process the data based on its contents rather than its location, which feels nicer to me.)

Anyway, there are a few related improvements required to get this to work. The smaller improvement required is for there to be a key for python interpreters (NewType around string with some minor validation, wrapped in an Optional), and then each Fragment type gets an associated key, to allow for stuff like "processing coverage data under one interpreter, but generating coverage data under multiple interpreters". The bigger improvement, by my estimation, is to set up something like the Key system, but for installer names.

Let's put that aside for a moment and consider what the "run a Script Fragment code" has to look like now.

The big change this needs is to create a "combiner" protocol, and to create another registry-type object to house segments and metadata, complete with a utility function to combine these registries.

Let's see...

Around that point, I can step back and reorient.

I think for the next few days, I should take a break from this.

Anyway, I want to get to bed.

Good night.