So your suggestion would be:

Check each entry in search_dirs for glob.glob("setuptools*.whl") - if you find one, install it by explicit filename. Same for pip*.whl. Skip symlinks and directories, presumably?

OK. That puts back a (small) chunk of complexity that I'd removed by relying on pip doing the install, but I guess it's viable.

And yes, I know you added the checks recently - without those, the above approach would definitely not be viable because we could get all sorts of nasty failures and corner cases if people put invalid/unsupported wheels on search_dirs.