Skip to content

Commit 9a95611

Browse files
Feat: integrate uv in the ci pipelines and the docs (#1040)
* Feat: migrate codspeed workflow to uv * fix: some commands and pin 3.8 * fix: minor bugs * feat: migrate lint-pr action to uv * fix codespeed action * feat: migrate to uv for preview-deployments action * revert: changes revert to original * fix: poetry install bug in workflow * fix: Improve action and the speed * fix: Improve the speed of the action * fix: use the global packages * Migrate preview-deployments action to uv * feat: Migrate release-CI to uv
1 parent 4029312 commit 9a95611

File tree

4 files changed

+62
-30
lines changed

4 files changed

+62
-30
lines changed

.github/workflows/codspeed.yml

+15-8
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,38 @@ on:
99
# performance analysis in order to generate initial data.
1010
workflow_dispatch:
1111

12+
env:
13+
UV_SYSTEM_PYTHON: 1
14+
1215
jobs:
1316
benchmarks:
1417
runs-on: ubuntu-22.04
1518
steps:
1619
- uses: actions/checkout@v4
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v3
23+
1724
- uses: actions/setup-python@v5
1825
with:
1926
python-version: "3.8"
2027

21-
- name: Install dependencies
28+
29+
- name: Install dependencies with uv
2230
run: |
23-
python -m pip install --upgrade pip
24-
pip install poetry==1.3.0
25-
poetry export --with test --with dev --without-hashes --output requirements.txt
26-
pip install -r requirements.txt
27-
pip install -e .
31+
uv pip install poetry
32+
uv run poetry export --with test --with dev --without-hashes --output requirements.txt
33+
uv pip install -r requirements.txt
34+
uv pip install -e .
2835
- name: Add macos target
2936
if: matrix.os == 'macos'
3037
run: rustup target add aarch64-apple-darwin
3138
- name: Setup Rust part of the project
3239
run: |
3340
maturin build -i python --universal2 --out dist
34-
pip install --no-index --find-links=dist/ robyn
41+
uv pip install --no-index --find-links=dist/ robyn
3542
- name: Run benchmarks
3643
uses: CodSpeedHQ/action@v2
3744
with:
3845
token: ${{ secrets.CODSPEED_TOKEN }}
39-
run: pytest integration_tests --codspeed
46+
run: pytest integration_tests --codspeed

.github/workflows/lint-pr.yml

+14-8
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,26 @@ on:
44
pull_request:
55
branches: [main]
66

7+
8+
env:
9+
UV_SYSTEM_PYTHON: 1
10+
711
jobs:
812
lint:
913
runs-on: ubuntu-latest
1014
steps:
1115
- uses: actions/checkout@v4
12-
- name: Set up Python
13-
uses: actions/setup-python@v5
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v3
18+
19+
- uses: actions/setup-python@v5
1420
with:
15-
python-version: '3.x'
16-
- name: Install dependencies
21+
python-version: "3.11"
22+
23+
- name: Install dependencies with uv
1724
run: |
18-
python -m pip install --upgrade pip
19-
pip install ruff isort black
25+
uv pip install ruff isort black
2026
- name: Run linters
2127
run: |
22-
ruff check .
23-
isort --check-only --diff .
28+
uv run ruff check .
29+
uv run isort --check-only --diff .

.github/workflows/preview-deployments.yml

+14-5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
branches:
1212
- main
1313

14+
env:
15+
UV_SYSTEM_PYTHON: 1
16+
1417
jobs:
1518
macos:
1619
runs-on: macos-12
@@ -19,6 +22,8 @@ jobs:
1922
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
2023
steps:
2124
- uses: actions/checkout@v4
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v3
2227
- uses: actions/setup-python@v5
2328
with:
2429
python-version: ${{ matrix.python-version }}
@@ -32,15 +37,15 @@ jobs:
3237
args: -i python --release --out dist --no-sdist
3338
- name: Install build wheel - x86_64
3439
run: |
35-
pip install --force-reinstall dist/robyn*.whl
40+
uv pip install --force-reinstall dist/robyn*.whl
3641
cd ~ && python -c 'import robyn'
3742
- name: Build wheels - universal2
3843
uses: PyO3/maturin-action@v1
3944
with:
4045
args: -i python --release --universal2 --out dist --no-sdist
4146
- name: Install build wheel - universal2
4247
run: |
43-
pip install --force-reinstall dist/robyn*_universal2.whl
48+
uv pip install --force-reinstall dist/robyn*_universal2.whl
4449
cd ~ && python -c 'import robyn'
4550
4651
windows:
@@ -51,6 +56,8 @@ jobs:
5156
target: [x64, x86]
5257
steps:
5358
- uses: actions/checkout@v4
59+
- name: Install uv
60+
uses: astral-sh/setup-uv@v3
5461
- uses: actions/setup-python@v5
5562
with:
5663
python-version: ${{ matrix.python-version }}
@@ -64,7 +71,7 @@ jobs:
6471
- name: Install build wheel
6572
shell: bash
6673
run: |
67-
pip install --force-reinstall dist/robyn*.whl
74+
uv pip install --force-reinstall dist/robyn*.whl
6875
cd ~ && python -c 'import robyn'
6976
7077
linux:
@@ -76,6 +83,8 @@ jobs:
7683
steps:
7784
- uses: actions/checkout@v4
7885
- uses: dtolnay/rust-toolchain@stable
86+
- name: Install uv
87+
uses: astral-sh/setup-uv@v3
7988
- uses: actions/setup-python@v5
8089
with:
8190
python-version: ${{ matrix.python-version }}
@@ -88,7 +97,7 @@ jobs:
8897
- name: Install build wheel
8998
if: matrix.target == 'x86_64'
9099
run: |
91-
pip install --force-reinstall dist/robyn*.whl
100+
uv pip install --force-reinstall dist/robyn*.whl
92101
cd ~ && python -c 'import robyn'
93102
94103
linux-cross:
@@ -140,4 +149,4 @@ jobs:
140149
source venv/bin/activate
141150
pip install --upgrade pip setuptools wheel
142151
pip install --force-reinstall dist/robyn*.whl
143-
cd ~ && python -c 'import robyn'
152+
cd ~ && python -c 'import robyn'

.github/workflows/release-CI.yml

+19-9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
tags:
66
- v*
7+
env:
8+
UV_SYSTEM_PYTHON: 1
79
jobs:
810
macos:
911
runs-on: macos-12
@@ -12,7 +14,9 @@ jobs:
1214
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1315
steps:
1416
- uses: actions/checkout@v3
15-
- uses: actions/setup-python@v4
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@v3
19+
- uses: actions/setup-python@v5
1620
with:
1721
python-version: ${{ matrix.python-version }}
1822
- uses: dtolnay/rust-toolchain@stable
@@ -25,15 +29,15 @@ jobs:
2529
args: -i python --release --out dist
2630
- name: Install build wheel - x86_64
2731
run: |
28-
pip install --force-reinstall dist/robyn*.whl
32+
uv pip install --force-reinstall dist/robyn*.whl
2933
cd ~ && python -c 'import robyn'
3034
- name: Build wheels - universal2
3135
uses: PyO3/maturin-action@v1
3236
with:
3337
args: -i python --release --universal2 --out dist
3438
- name: Install build wheel - universal2
3539
run: |
36-
pip install --force-reinstall dist/robyn*_universal2.whl
40+
uv pip install --force-reinstall dist/robyn*_universal2.whl
3741
cd ~ && python -c 'import robyn'
3842
- name: Upload wheels
3943
uses: actions/upload-artifact@v3
@@ -48,7 +52,9 @@ jobs:
4852
target: [x64, x86]
4953
steps:
5054
- uses: actions/checkout@v3
51-
- uses: actions/setup-python@v4
55+
- name: Install uv
56+
uses: astral-sh/setup-uv@v3
57+
- uses: actions/setup-python@v5
5258
with:
5359
python-version: ${{ matrix.python-version }}
5460
architecture: ${{ matrix.target }}
@@ -61,7 +67,7 @@ jobs:
6167
- name: Install build wheel
6268
shell: bash
6369
run: |
64-
pip install --force-reinstall dist/robyn*.whl
70+
uv pip install --force-reinstall dist/robyn*.whl
6571
cd ~ && python -c 'import robyn'
6672
- name: Upload wheels
6773
uses: actions/upload-artifact@v3
@@ -77,7 +83,9 @@ jobs:
7783
steps:
7884
- uses: actions/checkout@v3
7985
- uses: dtolnay/rust-toolchain@stable
80-
- uses: actions/setup-python@v4
86+
- name: Install uv
87+
uses: astral-sh/setup-uv@v3
88+
- uses: actions/setup-python@v5
8189
with:
8290
python-version: ${{ matrix.python-version }}
8391
- name: Build Wheels
@@ -89,7 +97,7 @@ jobs:
8997
- name: Install build wheel
9098
if: matrix.target == 'x86_64'
9199
run: |
92-
pip install --force-reinstall dist/robyn*.whl
100+
uv pip install --force-reinstall dist/robyn*.whl
93101
cd ~ && python -c 'import robyn'
94102
- name: Upload wheels
95103
uses: actions/upload-artifact@v3
@@ -158,13 +166,15 @@ jobs:
158166
- uses: actions/download-artifact@v3
159167
with:
160168
name: wheels
161-
- uses: actions/setup-python@v4
169+
- name: Install uv
170+
uses: astral-sh/setup-uv@v3
171+
- uses: actions/setup-python@v5
162172
with:
163173
python-version: 3.x
164174
- name: Publish to PyPi
165175
env:
166176
TWINE_USERNAME: __token__
167177
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
168178
run: |
169-
pip install --upgrade twine
179+
uv pip install --upgrade twine
170180
twine upload --skip-existing *

0 commit comments

Comments
 (0)