Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor venv export to use explicit PythonExecutable lookup #21087

Merged
merged 4 commits into from
Jun 20, 2024

Conversation

cognifloyd
Copy link
Member

@cognifloyd cognifloyd commented Jun 19, 2024

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.

This refactor is pre-work for #20516.

@cognifloyd cognifloyd added category:new feature backend: Python Python backend-related issues labels Jun 19, 2024
@cognifloyd cognifloyd self-assigned this Jun 19, 2024
If the user set a particular python to use, do not try to be smart
and inject the interpreter_constraints.
Copy link
Member

@kaos kaos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@cognifloyd cognifloyd enabled auto-merge (squash) June 20, 2024 06:42
@cognifloyd cognifloyd merged commit bcbda76 into main Jun 20, 2024
25 checks passed
@cognifloyd cognifloyd deleted the cognifloyd/export-using-PythonExecutable branch June 20, 2024 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: Python Python backend-related issues category:new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants