Skip to content

Commit 0175965

Browse files
authored
enhancement: Use uv instead of pip during ci tests (#440)
This PR makes the Hyperion repo use `uv` during ci tests. `uv` is a replacement for `pip` written in rust. Ideally, ci tests should now be quicker ! No expected breakage from this PR since we don't use special pip functionalities (see https://astral.sh/blog/uv) We'll use the official setup python gh action with uv when it will be merged or implemented (see actions/setup-python#818).
1 parent 20149f3 commit 0175965

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

.github/workflows/lintandformat.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,22 @@ jobs:
1717
# Setup Python (faster than using Python container)
1818
- name: Setup Python
1919
uses: actions/setup-python@v5
20+
id: setup-python
2021
with:
2122
python-version: "3.11"
22-
cache: "pip"
23+
24+
- name: Cache uv folder
25+
id: cache-uv
26+
uses: actions/cache@v4
27+
with:
28+
path: ~/.cache/uv
29+
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-uv-${{ hashFiles('requirements-common.txt', 'requirements-dev.txt') }}
30+
31+
- name: Install uv
32+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
2333

2434
- name: Install dependencies
25-
run: |
26-
python -m pip install --upgrade pip
27-
pip install -r requirements-dev.txt
28-
pip install "fastapi[all]"
35+
run: uv pip install --system -r requirements-dev.txt
2936

3037
- name: Cache .ruff_cache folder
3138
id: ruff_cache

.github/workflows/test.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,22 @@ jobs:
3838
# Setup Python (faster than using Python container)
3939
- name: Setup Python
4040
uses: actions/setup-python@v5
41+
id: setup-python
4142
with:
4243
python-version: "3.11"
43-
cache: "pip"
44+
45+
- name: Cache uv folder
46+
id: cache-uv
47+
uses: actions/cache@v4
48+
with:
49+
path: ~/.cache/uv
50+
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-uv-${{ hashFiles('requirements-common.txt', 'requirements-dev.txt') }}
51+
52+
- name: Install uv
53+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
4454

4555
- name: Install dependencies
46-
run: |
47-
python -m pip install --upgrade pip
48-
pip install -r requirements-dev.txt
49-
pip install "fastapi[all]"
56+
run: uv pip install --system -r requirements-dev.txt
5057

5158
- name: Cache .pytest_cache folder
5259
id: pytest_cache

0 commit comments

Comments
 (0)