I’m only just catching up with this thread - how much of the primary problem would be solved by just releasing a wheel tagged for the unsupported version that only contains a specific error message? e.g:
Lib/site-packages/numba.py:
> raise ImportError("numba is currently unsupported on Python 3.11. "
"Please use Python 3.10 or earlier, or specify --pre "
"to install our current prerelease build. "
"Visit <our URL here> for updates on new releases.")
You’d have this as a totally separate repo and carefully only release wheels that are not supported, so that users can explicitly --no-binary
to build from source (which I find myself doing from time to time, so would like to keep it this simple rather than having to patch the sdist first), but most are going to quickly get the wheel with the explanation.
It’s obviously not as ideal as failing at the resolution stage (and I think my selector packages idea would be a better approach for solving this kind of edge case there, as well as the others), but what I propose above would work today with no changes to any tooling.
(Oh, and I voted for “don’t support upper caps in resolvers, and warn about it in build tools” earlier, but you probably could have guessed that from my proposal )