Coding 2025-01-25
Okay, let's think a little more about the API improvements that I want. The basic point of confusion I'm hitting is in the design of some classes for wrapping Python packages. Basically...
It is often the case that a Python package that installs a script or a runnable module will have the same name as that script or module. From a reporting perspective, it makes sense to put the output of a script into a distinct directory, and the name of the script is usually a good candidate for the name of the directory.
So, given a script/module, by default we want to install the package of the same name, and put output in a directory of the same name. There are several points of possible variance here:
- The package requires extras to be specified.
- The package requires a version range.
- The package has a different name.
- Additional packages need to be installed.
- The output should go in a directory with a different name.
- The output should not go into a different directory. (This is simplified from what actually happens, which is a little fiddlier to explain, but should be intuitive in practice.)
Thinking about this, I'm kind of tempted to make everything run off of str.format(). The requirements should go in the object, and I'm not sure whether the directory should go in the object, or be specified in the call to convert the object to a form legible to the lower layers of abstraction.
I think this gets the bulk of the planning on this taken care of. Hopefully, I'll get the rest of the details worked out soon.
For now, I'm going to wind down.
Good night.