I’m only responding to a few points to help keep discussion focused - not to ignore the rest of the posts, just to avoid repetition or contributing where I don’t have anything of value above what’s already posted.
My suggestion to Brett was to follow PEP 517, but I’m inclined to think this is the better interface in these days of “everything is Rust”. Still, wouldn’t be hard to make a Python API in a single script that translates to this - I don’t think we’re too worried about the “zero Python runtimes on the machine” case, but if we are, adopting an existing stdin/out-based protocol would make sense. As long as the interface doesn’t involve dealing with shell quoting/etc.
Requiring a Python interface also deals with a lot of the “search PATH” and cross-platform issues for more casually installed tools, such as using a setup script that’s in the repository itself. So I still favour that approach and figure we’ll eventually deal with people who want to use Python without getting Python with relocatable builds.
Agree with this list. I think the exec command needs some way to return a Popen-equivalent object so the caller can pipe stdin/out and wait for completion, but that’s the biggest complexity here. We can’t really rely on piping it all back via the interface, so it probably requires more pass-forward arguments to connect up streams.
What we can’t rely on is having the interface return the full command line and let the caller launch it, unfortunately. Too many environments require setup that can’t/shouldn’t just be faked with environment variables. So the direction you’ve proposed is the right one IMHO.
My suggestion was that “no workflow tool defined” implies a specific default workflow tool (to be implemented) that uses venv to create an environment at .venv and can launch it. None of which needs to be overspecified here, as long as people are happy to say “tools that normally use the project’s defined workflow tool may use this one if the tool doesn’t say so, rather than throwing up your hands and making your user figure it out on their own” (and since this would only be in response to the user clicking a “set it up for me button”, I’m quite okay with this as a default).
This is one of the things I think we don’t need to define, we just need to make sure we don’t forbid it. UI tools can offer whatever customisation they like, up to and including seeing the name of a defined workflow tool and using something else entirely (if they’re willing to deal with upset/confused users, but I can think of valid cases for this, mostly involving constrained enterprise environments).