Okay, after I posted last night, I got the isolated environment of pyproject-build probably working. The next step is to allow the pip-related functionality to handle environment variables. This is because I kind of don't trust the result of passing constraint files on the command line, even though it's probably fine. It's been a while since doing that bit me, and a lot has changed. I think the bug I filed is still open, though.
So, I'm passing in an environment, and that's getting processed by the cmd function, which will handle Input instances... That means I can just hardcode the environment variables in a global dictionary for now. When I was looking over one of my noxfiles to get environment-related data, I noticed that I'm also setting "PIP_NO_CACHE_DIR": "YES". My vague recollection is that this was to deal with local packages sometimes not updating, but it looks like that was maybe an sdist issue? I certainly haven't encountered it using wheels, so I don't think I need it. (The "specify it as an environment variable" thing may have also been an artifact of using sdists?) (Did I only need to use sdists because of some flit-related behavior that has since apparently changed? There we go, yes. Okay, wait, I think I was using sdists indirectly, because I was pointing pip at a directory rather than at a file? Well, there are so many reasons not to want to go back to that.)
Anyway, back to what I need to work on now. I've somewhat solidified the classes I need for this to work, and now it's a question of tracking down the various usages and updating then to work with a SinglePythonPackage, then writing an adaptor that dispatches over a MultiPythonPackage, which is almost, but not quite, just a sequence of SinglePythonPackages. I also need to generate the MultiPythonPackage for the MOTR project. That can be handled for now by just hardcoding a reference to the current directory.
I don't know when I'll be up for working on that. I kind of don't like working on this during the week, and I'm starting to make some real progress on the setting document. Anyway, none of that's going to happen right now, because I need to wrap up and get to bed.