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

Always provide Python-for-Pants-scripts (Cherry-pick of #18433) #18495

Merged

Conversation

thejcannon
Copy link
Member

This PR decouples the Python Pants uses for its own nefarious purposes (like running PEX or gunzip) from the user search paths by either using sys.executable locally or downloading and using Python Build Standalone in a Docker environment.

Additionally when making this change, the Python/pex code was refactored so that we always use this Python to run pex, with Python either being chosen by pex, or by using PEX_PYTHON env var at runtime. I think this is a nice cleanup of the handshake between CompletePexEnvironment.create_argv and CompletePexEnvironment.environment_dict used to have.

On a side note, this (with scie-pants and #18352) this marks a complete divorce from any Python on the user system (or lack thereof) and running Python code.

This PR decouples the Python Pants uses for its own nefarious purposes
(like running PEX or `gunzip`) from the user search paths by either
using `sys.executable` locally or downloading and using Python Build
Standalone in a Docker environment.

Additionally when making this change, the Python/pex code was refactored
so that we always use this Python to run pex, with Python either being
chosen by pex, or by using `PEX_PYTHON` env var at runtime. I think this
is a nice cleanup of the handshake between
`CompletePexEnvironment.create_argv` and
`CompletePexEnvironment.environment_dict` used to have.

On a side note, this (with `scie-pants` and
pantsbuild#18352) this marks a complete
divorce from any Python on the user system (or lack thereof) and running
Python code.
@kaos
Copy link
Member

kaos commented Mar 14, 2023

do we have any guiding criteria for when we pick non-bugfixes/doc-changes to release branches?

@thejcannon
Copy link
Member Author

thejcannon commented Mar 14, 2023

Maybe I'm stretching it a bit, but I meant for this to be in 2.16.x. I just missed the train 😭 .

I'm OK punting though, I just don't want to 😛

@kaos
Copy link
Member

kaos commented Mar 14, 2023

I'm fine with it, just want us to be intentional with if this will be an exception or not. (holding out my approve a little to give room for more opinions..)

Copy link
Member

@stuhood stuhood left a comment

Choose a reason for hiding this comment

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

I'm fine cherry-picking this as long as we do another 2.16.0a release. But we need to continue to watch out for large picks, and not do them at all after an rc is out... the PEX / python_sources that got picked in 2.15.x were rocky.

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.

I'm fine cherry-picking this as long as we do another 2.16.0a release. But we need to continue to watch out for large picks, and not do them at all after an rc is out... the PEX / python_sources that got picked in 2.15.x were rocky.

Thanks, so that makes sense. No feat picks into rc releases--which then implies that if you pick onto an alpha that will add another alpha before we go to rc. Is there room for this some where in the release strategy docs perhaps?

@stuhood
Copy link
Member

stuhood commented Mar 14, 2023

I'm fine cherry-picking this as long as we do another 2.16.0a release. But we need to continue to watch out for large picks, and not do them at all after an rc is out... the PEX / python_sources that got picked in 2.15.x were rocky.

Thanks, so that makes sense. No feat picks into rc releases--which then implies that if you pick onto an alpha that will add another alpha before we go to rc. Is there room for this some where in the release strategy docs perhaps?

It is mentioned, and calls for "extenuating circumstances": https://www.pantsbuild.org/docs/release-strategy#alpha-releases

@thejcannon
Copy link
Member Author

Appreciate the understanding y'all. I definitely owe everyone a blog post about this

@kaos
Copy link
Member

kaos commented Mar 14, 2023

I'm fine cherry-picking this as long as we do another 2.16.0a release. But we need to continue to watch out for large picks, and not do them at all after an rc is out... the PEX / python_sources that got picked in 2.15.x were rocky.

Thanks, so that makes sense. No feat picks into rc releases--which then implies that if you pick onto an alpha that will add another alpha before we go to rc. Is there room for this some where in the release strategy docs perhaps?

Is it mentioned, and calls for "extenuating circumstances": https://www.pantsbuild.org/docs/release-strategy#alpha-releases

Ah.. coming from this side, that is clear. Having read only that does not make this side clear--so a few extra words, as an example for what an extenuating circumstance might be and what that implies, could be helpful. I'm up for writing it if that sounds sensible.

@thejcannon thejcannon merged commit d3d3257 into pantsbuild:2.16.x Mar 14, 2023
@stuhood
Copy link
Member

stuhood commented Mar 14, 2023

Ah.. coming from this side, that is clear. Having read only that does not make this side clear--so a few extra words, as an example for what an extenuating circumstance might be and what that implies, could be helpful. I'm up for writing it if that sounds sensible.

Yea, feel free!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants