Description
Right now, pip.parse uses a combination of the provided interpreter and python_version to figure out all the things it needs to do.
- The interpreter is used for running pip. This is unfortunately required until we can decouple dependency resolution from the interpreter being used.
- The python version is used to generate aliases, select expressions, and version-specific repo names. This is all mostly working as desired.
In PR #1254, some additional logic was added to infer python_version from the interpreter label (based upon our internal naming conventions). This makes configuring pip.parse a bit easier, as the python_version arg doesn't need to be provided (so 1 less line), however, it still requires the users to use the interpreter
extension (adds ~8-10 lines).
If we changed the logic to infer the interpreter from the python version, this would eliminate the need for the interpreter extension. (Note: this was originally proposed by Ignas elsewhere)
This also better represents the user's intent. They want to resolve dependencies for e.g. Python 3.10; the exact mechanism (e.g. interpreter) isn't relevant. This is relevant to Phil's work to decouple dependency resolution from the interpreter being used.
This would probably also enable multi-version requirements files using env markers, so now users don't have to have a separate requirements file for every version.