Skip to content

[GHA] Add new setup-python action #983

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mhegazy
Copy link
Contributor

@mhegazy mhegazy commented Jun 30, 2025

Add a new GH Action to setup python using uv. Also adding explicit calls to setup uv where we are executing python scripts.

Downstream CI run with an image not including python (thebrowsercompany/swift-build#302):
https://github.com/thebrowsercompany/swift-build/actions/runs/15982191821

@mhegazy mhegazy changed the title Setup python action [GHA] Setup python action Jun 30, 2025
@mhegazy mhegazy changed the title [GHA] Setup python action [GHA] Add new setup-python action Jun 30, 2025
@mhegazy mhegazy marked this pull request as ready for review June 30, 2025 23:25
Copy link
Owner

@compnerd compnerd left a comment

Choose a reason for hiding this comment

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

I would prefer avoiding uv. This is not used in the Swift.org builds, and diverging the builds further makes it harder to maintain. We already try to synchronise the build between build.ps1 and GHA, adding a diff on top is more complicated. Why can we not just fetch python if we want to use our own copy?

@mhegazy
Copy link
Contributor Author

mhegazy commented Jul 1, 2025

UV is doing that for us. we are still using python to run commands. what this action does is download a specific python version (specified in pyproject.toml), and sets it in the path. we could switch to a custom action, but it will do more or less the same, find architecture, find the right package to download, and then install/expand and set in the path.

@compnerd
Copy link
Owner

compnerd commented Jul 1, 2025

Yes, I realize what uv is being used for; I think that using actions/setup-python is better for that purpose. This introduces a third party dependency (and with the desire to eventually have this repository be merged into swiftlang, that complicates things further). I would rather use GitHub actions whenever there is an alternative.

@mhegazy mhegazy force-pushed the setup-python-action branch from 2d08d0d to 2d02b11 Compare July 2, 2025 02:16
@mhegazy mhegazy requested a review from compnerd July 2, 2025 02:16
@mhegazy
Copy link
Contributor Author

mhegazy commented Jul 2, 2025

@compnerd reverted back to github's actions/setup-python

@mhegazy
Copy link
Contributor Author

mhegazy commented Jul 2, 2025

Please hold off on merging this. i need to get a successful downstream run first.

@mhegazy mhegazy force-pushed the setup-python-action branch from 0067bf3 to dba409e Compare July 2, 2025 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants