mirror of
https://github.com/servo/servo.git
synced 2025-08-09 07:25:35 +01:00
mach: switch to uv
for managing python venv (#34504)
This patch switches servo to use `uv` for both installing a pinned Python version as well as installing the dependency packages using `uv`'s pip compatible interface. It 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 Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This commit is contained in:
parent
a0743f60b3
commit
4103421ba5
22 changed files with 100 additions and 80 deletions
4
.github/workflows/android.yml
vendored
4
.github/workflows/android.yml
vendored
|
@ -59,8 +59,8 @@ jobs:
|
|||
uses: mozilla-actions/sccache-action@v0.0.6
|
||||
- name: Install crown
|
||||
run: cargo install --path support/crown
|
||||
- name: Bootstrap Python
|
||||
run: python3 -m pip install --upgrade pip virtualenv
|
||||
- name: Setup Python
|
||||
uses: ./.github/actions/setup-python
|
||||
- name: Bootstrap dependencies
|
||||
run: sudo apt update && python3 ./mach bootstrap --skip-lints
|
||||
- name: Set up JDK 17
|
||||
|
|
3
.github/workflows/docs.yml
vendored
3
.github/workflows/docs.yml
vendored
|
@ -13,9 +13,10 @@ jobs:
|
|||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup Python
|
||||
uses: ./.github/actions/setup-python
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
python3 -m pip install --upgrade pip
|
||||
sudo apt update
|
||||
python3 ./mach bootstrap --skip-lints
|
||||
- name: Set LIBCLANG_PATH # This is needed for bindgen in mozangle.
|
||||
|
|
9
.github/workflows/lint.yml
vendored
9
.github/workflows/lint.yml
vendored
|
@ -31,9 +31,8 @@ jobs:
|
|||
uses: mozilla-actions/sccache-action@v0.0.6
|
||||
- name: Set LIBCLANG_PATH env # needed for bindgen in mozangle
|
||||
run: echo "LIBCLANG_PATH=/usr/lib/llvm-14/lib" >> $GITHUB_ENV
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- name: Setup Python
|
||||
uses: ./.github/actions/setup-python
|
||||
- name: Install taplo
|
||||
uses: baptiste0928/cargo-install@v3
|
||||
with:
|
||||
|
@ -46,8 +45,6 @@ jobs:
|
|||
locked: true
|
||||
# 0.16.2 requires Rust 1.81 or newer.
|
||||
version: '0.16.1'
|
||||
- name: Bootstrap Python
|
||||
run: python3 -m pip install --upgrade pip
|
||||
- name: Bootstrap dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
|
@ -57,4 +54,4 @@ jobs:
|
|||
run: |
|
||||
python3 ./mach clippy --use-crown --locked -- -- --deny warnings
|
||||
- name: Tidy
|
||||
run: python3 ./mach test-tidy --no-progress --all
|
||||
run: python3 ./mach test-tidy --no-progress --all
|
||||
|
|
3
.github/workflows/linux-wpt.yml
vendored
3
.github/workflows/linux-wpt.yml
vendored
|
@ -52,9 +52,10 @@ jobs:
|
|||
path: ${{ inputs.profile }}-binary-linux
|
||||
- name: unPackage binary
|
||||
run: tar -xzf ${{ inputs.profile }}-binary-linux/target.tar.gz
|
||||
- name: Setup Python
|
||||
uses: ./.github/actions/setup-python
|
||||
- name: Bootstrap dependencies
|
||||
run: |
|
||||
python3 -m pip install --upgrade pip
|
||||
sudo apt update
|
||||
sudo apt install -qy --no-install-recommends mesa-vulkan-drivers
|
||||
python3 ./mach bootstrap --skip-lints
|
||||
|
|
9
.github/workflows/linux.yml
vendored
9
.github/workflows/linux.yml
vendored
|
@ -139,13 +139,10 @@ jobs:
|
|||
- name: Set LIBCLANG_PATH env # needed for bindgen in mozangle
|
||||
if: ${{ ! fromJSON(needs.runner-select.outputs.is-self-hosted) && !inputs.upload }} # not needed on ubuntu 20.04 used for nightly
|
||||
run: echo "LIBCLANG_PATH=/usr/lib/llvm-14/lib" >> $GITHUB_ENV
|
||||
- uses: actions/setup-python@v5
|
||||
if: ${{ ! fromJSON(needs.runner-select.outputs.is-self-hosted) }}
|
||||
- name: Setup Python
|
||||
uses: ./.github/actions/setup-python
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- name: Bootstrap Python
|
||||
if: ${{ ! fromJSON(needs.runner-select.outputs.is-self-hosted) }}
|
||||
run: python3 -m pip install --upgrade pip
|
||||
skip-python-setup: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }}
|
||||
- name: Bootstrap dependencies
|
||||
if: ${{ ! fromJSON(needs.runner-select.outputs.is-self-hosted) }}
|
||||
run: |
|
||||
|
|
8
.github/workflows/mac-wpt.yml
vendored
8
.github/workflows/mac-wpt.yml
vendored
|
@ -41,15 +41,11 @@ jobs:
|
|||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ${{ inputs.profile }}-binary-macos
|
||||
# Python 3.13 breaks wptrunner, so pin the version until
|
||||
# web-platform-tests/wpt#48585 is fixed.
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
- name: Setup Python
|
||||
uses: ./.github/actions/setup-python
|
||||
- name: Prep test environment
|
||||
run: |
|
||||
gtar -xzf target.tar.gz
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 ./mach bootstrap --skip-lints
|
||||
- name: Smoketest
|
||||
run: python3 ./mach smoketest --${{ inputs.profile }}
|
||||
|
|
8
.github/workflows/mac.yml
vendored
8
.github/workflows/mac.yml
vendored
|
@ -77,18 +77,14 @@ jobs:
|
|||
if: github.event_name == 'pull_request_target'
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
# Python 3.13 breaks wptrunner, so pin the version until
|
||||
# web-platform-tests/wpt#48585 is fixed.
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
- name: Setup Python
|
||||
uses: ./.github/actions/setup-python
|
||||
- name: Run sccache-cache
|
||||
uses: mozilla-actions/sccache-action@v0.0.6
|
||||
- name: Install crown
|
||||
run: cargo install --path support/crown
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 ./mach bootstrap --skip-lints
|
||||
brew install gnu-tar
|
||||
- name: Build (${{ inputs.profile }})
|
||||
|
|
7
.github/workflows/main.yml
vendored
7
.github/workflows/main.yml
vendored
|
@ -20,15 +20,16 @@ jobs:
|
|||
outputs:
|
||||
configuration: ${{ steps.configuration.outputs.result }}
|
||||
steps:
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
sparse-checkout: |
|
||||
python/servo/try_parser.py
|
||||
.github/actions/setup-python
|
||||
.python-version
|
||||
sparse-checkout-cone-mode: false
|
||||
- name: Setup Python
|
||||
uses: ./.github/actions/setup-python
|
||||
- name: Get Configuration
|
||||
id: configuration
|
||||
run: |
|
||||
|
|
4
.github/workflows/ohos.yml
vendored
4
.github/workflows/ohos.yml
vendored
|
@ -53,8 +53,8 @@ jobs:
|
|||
uses: mozilla-actions/sccache-action@v0.0.6
|
||||
- name: Install crown
|
||||
run: cargo install --path support/crown
|
||||
- name: Bootstrap Python
|
||||
run: python3 -m pip install --upgrade pip virtualenv
|
||||
- name: Setup Python
|
||||
uses: ./.github/actions/setup-python
|
||||
- name: Bootstrap dependencies
|
||||
run: sudo apt update && python3 ./mach bootstrap --skip-lints
|
||||
- name: Setup OpenHarmony SDK
|
||||
|
|
10
.github/workflows/pull-request-wpt-export.yml
vendored
10
.github/workflows/pull-request-wpt-export.yml
vendored
|
@ -28,10 +28,16 @@ jobs:
|
|||
# using the token specified here.
|
||||
# See https://github.com/actions/checkout/issues/162.
|
||||
token: ${{ secrets.WPT_SYNC_TOKEN }}
|
||||
- name: Setup Python
|
||||
uses: ./.github/actions/setup-python
|
||||
- name: Install requirements
|
||||
run: pip install -r servo/python/requirements.txt
|
||||
run: |
|
||||
uv venv
|
||||
uv pip install -r servo/python/requirements.txt
|
||||
- name: Process pull request
|
||||
run: servo/python/wpt/export.py
|
||||
run: |
|
||||
source .venv/bin/activate
|
||||
servo/python/wpt/export.py
|
||||
env:
|
||||
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||
WPT_SYNC_TOKEN: ${{ secrets.WPT_SYNC_TOKEN }}
|
||||
|
|
3
.github/workflows/scheduled-wpt-import.yml
vendored
3
.github/workflows/scheduled-wpt-import.yml
vendored
|
@ -35,9 +35,10 @@ jobs:
|
|||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: wpt-full-logs-linux-layout-2020
|
||||
- name: Setup Python
|
||||
uses: ./.github/actions/setup-python
|
||||
- name: Prep environment
|
||||
run: |
|
||||
python3 -m pip install --upgrade pip
|
||||
sudo apt update
|
||||
python3 ./mach bootstrap
|
||||
- name: Add upstream remote
|
||||
|
|
7
.github/workflows/try-label.yml
vendored
7
.github/workflows/try-label.yml
vendored
|
@ -77,14 +77,15 @@ jobs:
|
|||
}
|
||||
|
||||
return try_string;
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
sparse-checkout: |
|
||||
python/servo/try_parser.py
|
||||
.github/actions/setup-python
|
||||
.python-version
|
||||
sparse-checkout-cone-mode: false
|
||||
- name: Setup Python
|
||||
uses: ./.github/actions/setup-python
|
||||
- name: Parse Labels
|
||||
if: ${{ steps.try_string.outputs.result }}
|
||||
id: configuration
|
||||
|
|
7
.github/workflows/try.yml
vendored
7
.github/workflows/try.yml
vendored
|
@ -32,15 +32,16 @@ jobs:
|
|||
outputs:
|
||||
configuration: ${{ steps.configuration.outputs.result }}
|
||||
steps:
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
sparse-checkout: |
|
||||
python/servo/try_parser.py
|
||||
.github/actions/setup-python
|
||||
.python-version
|
||||
sparse-checkout-cone-mode: false
|
||||
- name: Setup Python
|
||||
uses: ./.github/actions/setup-python
|
||||
- name: Get Full Configuration
|
||||
id: full_config
|
||||
run: |
|
||||
|
|
6
.github/workflows/windows.yml
vendored
6
.github/workflows/windows.yml
vendored
|
@ -114,13 +114,13 @@ jobs:
|
|||
choco install wixtoolset
|
||||
echo "C:\\Program Files (x86)\\WiX Toolset v3.11\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
- uses: actions/setup-python@v5
|
||||
if: ${{ ! fromJSON(needs.runner-select.outputs.is-self-hosted) }}
|
||||
- name: Setup Python
|
||||
uses: ./.github/actions/setup-python
|
||||
with:
|
||||
python-version: "3.10"
|
||||
skip-python-setup: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }}
|
||||
- name: Bootstrap
|
||||
if: ${{ ! fromJSON(needs.runner-select.outputs.is-self-hosted) }}
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
python mach fetch
|
||||
python mach bootstrap-gstreamer
|
||||
# For some reason WiX isn't currently on the GitHub runner path. This is a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue