Instead of relying on the implicit pex interpreter resolution--based on interpreter_constraints--this PR makes the export pre-calculate which interpreter to use.
This has the benefit of allowing pants to provide the python interpreter (eg with pyenv) if configured to do so. Without this, the exports can only use pre-installed interpreters.
To make this work, I had to prevent the injection of PexRequest.interpreter_constraints when PexRequest.python is set.
Instead of relying on the implicit pex interpreter resolution--based on interpreter_constraints--this PR makes the export pre-calculate which interpreter to use.
This has the benefit of allowing pants to provide the python interpreter (eg with pyenv) if configured to do so. Without this, the exports can only use pre-installed interpreters.
To make this work, I had to prevent the injection of
PexRequest.interpreter_constraints
whenPexRequest.python
is set.This refactor is pre-work for #20516.