aboutsummaryrefslogtreecommitdiffstats
path: root/.github/actions/setup-python
diff options
context:
space:
mode:
authorMukilan Thiyagarajan <mukilan@igalia.com>2024-12-16 14:50:37 +0530
committerGitHub <noreply@github.com>2024-12-16 09:20:37 +0000
commit88a35b3cc99b6bf47099f1551b6a2349bba76c15 (patch)
tree67ad14a3a325e09c614b2ad53da50b846d023661 /.github/actions/setup-python
parentf757fa46acc865f42205d152dd06e381a674f788 (diff)
downloadservo-88a35b3cc99b6bf47099f1551b6a2349bba76c15.tar.gz
servo-88a35b3cc99b6bf47099f1551b6a2349bba76c15.zip
mach: adopt `uv` and avoid system python (#34632)
This allows us to use `uv` for: 1. Installing a pinned Python version 2. Installing the dependency packages using `uv`'s pip compatible interface. 4. Bootstrapping `mach` without a Python installion on the host, using `uv run` This change also introduces a new 'composite' GitHub action to setup python in the different CI workflows. There is no support for externally managed python installations and virtual environments. These could be added in the future. Fixes #34095, #34547 Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Diffstat (limited to '.github/actions/setup-python')
-rw-r--r--.github/actions/setup-python/action.yml20
1 files changed, 20 insertions, 0 deletions
diff --git a/.github/actions/setup-python/action.yml b/.github/actions/setup-python/action.yml
new file mode 100644
index 00000000000..9889c517e6b
--- /dev/null
+++ b/.github/actions/setup-python/action.yml
@@ -0,0 +1,20 @@
+name: Setup Python and uv
+inputs:
+ skip-python-setup:
+ required: false
+ description: "Whether to skip installing python using Github's `setup-python` action"
+ default: false
+runs:
+ using: "composite"
+ steps:
+ # Use the setup-python action to take advantage of the cache. uv will
+ # symlink to this version.
+ - name: Setup system python
+ if: ${{ inputs.skip-python-setup != 'true' }}
+ uses: actions/setup-python@v5
+ with:
+ python-version-file: '.python-version'
+ - name: Install uv
+ uses: astral-sh/setup-uv@v4
+ with:
+ version: "0.5.6"