Skip to content

[GHA] Support running on hosts without pre-configured python 3.9 #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

Merged
merged 4 commits into from
Aug 1, 2025

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
@mhegazy mhegazy force-pushed the setup-python-action branch from dba409e to b6c64da Compare July 28, 2025 22:00
@mhegazy mhegazy changed the title [GHA] Add new setup-python action [GHA] Support running on hosts without pre-configured python 3.9 Jul 29, 2025
@mhegazy
Copy link
Contributor Author

mhegazy commented Jul 29, 2025

@compnerd this should be updated now. downstream change passed CI on cirun and githhub: thebrowsercompany/swift-build#302

@mhegazy mhegazy force-pushed the setup-python-action branch from b6c64da to b610963 Compare July 31, 2025 22:10
@mhegazy
Copy link
Contributor Author

mhegazy commented Jul 31, 2025

@compnerd one more iteration. using 3.9 now. downstream PR runs are passing at thebrowsercompany/swift-build#302

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.

This seems reasonable to me. One thing that we should consider is hoisting this to a global value. I'm fine with that being a follow up or done here.

@compnerd
Copy link
Owner

compnerd commented Aug 1, 2025

Discussed offline, the global value conversion can be done as a follow up.

@compnerd compnerd merged commit 2c8785c into compnerd:main Aug 1, 2025
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