-
-
Notifications
You must be signed in to change notification settings - Fork 647
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
use explicit setup-python versions over implicit expose- #21568
Conversation
913c342
to
ffcfa9c
Compare
The project is currently using a mix of the GitHub supplied `setup-python` action and `pantsbuild/actions/expose-pythons`. On GitHub managed runners they behave similarly: * `setup-python` will install a version of Python if missing, or add it to the PATH if already present at the expected location (managed runners historically have multiple Pythons baked into the image) * `expose-pythons` will add all Python's at the expected GitHub location to the PATH. (Which ones is up to GitHub.) So today the invocation of `setup-python` followed by `expose-pythons` is redundant. Consolidating on `setup-python` let's us be explicit about expected versions (more like the ARM image) and reduces the number of custom actions the project manages while still making multiple Python versions available. NOTE: The awkward double newlines in the final yaml are a pre-existing issue https://stackoverflow.com/questions/45004464/yaml-dump-adding-unwanted-newlines-in-multiline-strings See pantsbuild#21552 for some history regarding the `setup-` vs `expose-` actions.
ffcfa9c
to
8d6516d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems very sensible to be explicit about which Python versions are desirable!
This fixes the "Build wheels (macOS12-x86_64)" CI job, by installing Python. It was previously failing with errors like: ``` > Run ./pants run src/python/pants_release/release.py -- build-wheels pants: Failed to find a Python 3.9 interpreter ``` I think this was a small oversight in #21568 (in particular https://github.com/pantsbuild/pants/pull/21568/files#diff-b980287839311482e79f8adac1fdd7768274cf1e677a1103d9444185e4aabbd1L890), which wasn't caught by CI because the build-wheels jobs were skipped.
I tried to automatically cherry-pick this change back to each relevant milestone, so that it is available in those older releases of Pants. ❌ 2.22.xI was unable to cherry-pick this PR to 2.22.x, likely due to merge-conflicts. Steps to Cherry-Pick locallyTo resolve:
Please note that I cannot re-run CI if a job fails. Please work with your PR approver(s) to re-run CI if necessary. ❌ 2.23.xI was unable to cherry-pick this PR to 2.23.x, likely due to merge-conflicts. Steps to Cherry-Pick locallyTo resolve:
Please note that I cannot re-run CI if a job fails. Please work with your PR approver(s) to re-run CI if necessary. ❌ 2.24.xI was unable to cherry-pick this PR to 2.24.x, likely due to merge-conflicts. Steps to Cherry-Pick locallyTo resolve:
Please note that I cannot re-run CI if a job fails. Please work with your PR approver(s) to re-run CI if necessary. When you're done manually cherry-picking, please remove the Thanks again for your contributions! |
The project is currently using a mix of the GitHub supplied `setup-python` action and `pantsbuild/actions/expose-pythons`. On GitHub managed runners they behave similarly: * `setup-python` will install a version of Python if missing, or add it to the PATH if already present at the expected location (managed runners historically have multiple Pythons baked into the image) * `expose-pythons` will add all Python's at the expected GitHub location to the PATH. (Which ones is up to GitHub.) So today the invocation of `setup-python` followed by `expose-pythons` is redundant. Consolidating on `setup-python` let's us be explicit about expected versions (more like the ARM image) and reduces the number of custom actions the project manages while still making multiple Python versions available. NOTE: The awkward double newlines in the final yaml are a pre-existing issue https://stackoverflow.com/questions/45004464/yaml-dump-adding-unwanted-newlines-in-multiline-strings See #21552 for some history regarding the `setup-` vs `expose-` actions.
This fixes the "Build wheels (macOS12-x86_64)" CI job, by installing Python. It was previously failing with errors like: ``` > Run ./pants run src/python/pants_release/release.py -- build-wheels pants: Failed to find a Python 3.9 interpreter ``` I think this was a small oversight in #21568 (in particular https://github.com/pantsbuild/pants/pull/21568/files#diff-b980287839311482e79f8adac1fdd7768274cf1e677a1103d9444185e4aabbd1L890), which wasn't caught by CI because the build-wheels jobs were skipped.
The project is currently using a mix of the GitHub supplied `setup-python` action and `pantsbuild/actions/expose-pythons`. On GitHub managed runners they behave similarly: * `setup-python` will install a version of Python if missing, or add it to the PATH if already present at the expected location (managed runners historically have multiple Pythons baked into the image) * `expose-pythons` will add all Python's at the expected GitHub location to the PATH. (Which ones is up to GitHub.) So today the invocation of `setup-python` followed by `expose-pythons` is redundant. Consolidating on `setup-python` let's us be explicit about expected versions (more like the ARM image) and reduces the number of custom actions the project manages while still making multiple Python versions available. NOTE: The awkward double newlines in the final yaml are a pre-existing issue https://stackoverflow.com/questions/45004464/yaml-dump-adding-unwanted-newlines-in-multiline-strings See #21552 for some history regarding the `setup-` vs `expose-` actions.
This fixes the "Build wheels (macOS12-x86_64)" CI job, by installing Python. It was previously failing with errors like: ``` > Run ./pants run src/python/pants_release/release.py -- build-wheels pants: Failed to find a Python 3.9 interpreter ``` I think this was a small oversight in #21568 (in particular https://github.com/pantsbuild/pants/pull/21568/files#diff-b980287839311482e79f8adac1fdd7768274cf1e677a1103d9444185e4aabbd1L890), which wasn't caught by CI because the build-wheels jobs were skipped.
… of #21568, #21582) (#21667) The project is currently using a mix of the GitHub supplied `setup-python` action and `pantsbuild/actions/expose-pythons`. On GitHub managed runners they behave similarly: * `setup-python` will install a version of Python if missing, or add it to the PATH if already present at the expected location (managed runners historically have multiple Pythons baked into the image) * `expose-pythons` will add all Python's at the expected GitHub location to the PATH. (Which ones is up to GitHub.) So today the invocation of `setup-python` followed by `expose-pythons` is redundant. Consolidating on `setup-python` let's us be explicit about expected versions (more like the ARM image) and reduces the number of custom actions the project manages while still making multiple Python versions available. NOTE: The awkward double newlines in the final yaml are a pre-existing issue https://stackoverflow.com/questions/45004464/yaml-dump-adding-unwanted-newlines-in-multiline-strings See #21552 for some history regarding the `setup-` vs `expose-` actions. --------- Co-authored-by: cburroughs <chris.burroughs@gmail.com>
… of #21568, #21582) (#21668) The project is currently using a mix of the GitHub supplied `setup-python` action and `pantsbuild/actions/expose-pythons`. On GitHub managed runners they behave similarly: * `setup-python` will install a version of Python if missing, or add it to the PATH if already present at the expected location (managed runners historically have multiple Pythons baked into the image) * `expose-pythons` will add all Python's at the expected GitHub location to the PATH. (Which ones is up to GitHub.) So today the invocation of `setup-python` followed by `expose-pythons` is redundant. Consolidating on `setup-python` let's us be explicit about expected versions (more like the ARM image) and reduces the number of custom actions the project manages while still making multiple Python versions available. NOTE: The awkward double newlines in the final yaml are a pre-existing issue https://stackoverflow.com/questions/45004464/yaml-dump-adding-unwanted-newlines-in-multiline-strings See #21552 for some history regarding the `setup-` vs `expose-` actions. --------- Co-authored-by: cburroughs <chris.burroughs@gmail.com>
The project is currently using a mix of the GitHub supplied
setup-python
action andpantsbuild/actions/expose-pythons
. On GitHub managed runners they behave similarly:setup-python
will install a version of Python if missing, or add it to the PATH if already present at the expected location (managed runners historically have multiple Pythons baked into the image)expose-pythons
will add all Python's at the expected GitHub location to the PATH. (Which ones is up to GitHub.)So today the invocation of
setup-python
followed byexpose-pythons
is redundant.Consolidating on
setup-python
let's us be explicit about expected versions (more like the ARM image) and reduces the number of custom actions the project manages while still making multiple Python versions available.NOTE: The awkward double newlines in the final yaml are a pre-existing issue
https://stackoverflow.com/questions/45004464/yaml-dump-adding-unwanted-newlines-in-multiline-strings
See #21552 for some history regarding the
setup-
vsexpose-
actions.