Skip to content

Commit 111d9dc

Browse files
committed
update workflows with uv
1 parent 5852031 commit 111d9dc

File tree

2 files changed

+19
-25
lines changed

2 files changed

+19
-25
lines changed

.github/workflows/new_tasks.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,28 +44,24 @@ jobs:
4444
echo "One or more test file(s) has changed."
4545
echo "List of all the files that have changed: ${{ steps.changed-tasks.outputs.tasks_all_modified_files }}"
4646
47-
- name: Set up Python 3.10
47+
- name: Install uv
4848
if: steps.changed-tasks.outputs.tasks_any_modified == 'true' || steps.changed-tasks.outputs.api_any_modified == 'true'
49-
uses: actions/setup-python@v5
49+
uses: astral-sh/setup-uv@v7
5050
with:
51-
python-version: '3.10'
52-
cache: 'pip'
53-
cache-dependency-path: pyproject.toml
51+
enable-cache: true
52+
python-version: "3.10"
5453
- name: Install dependencies
5554
if: steps.changed-tasks.outputs.tasks_any_modified == 'true' || steps.changed-tasks.outputs.api_any_modified == 'true'
5655
run: |
57-
python -m pip install --upgrade pip
58-
pip install -e '.[dev,ifeval,unitxt,math,longbench]' --extra-index-url https://download.pytorch.org/whl/cpu
59-
# Install optional git dependencies
60-
# pip install bleurt@https://github.com/google-research/bleurt/archive/b610120347ef22b494b6d69b4316e303f5932516.zip#egg=bleurt
61-
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
56+
uv venv
57+
uv pip install -e '.[dev,ifeval,unitxt,math,longbench]' --extra-index-url https://download.pytorch.org/whl/cpu
6258
- name: Test with pytest
6359
# if new tasks are added, run tests on them
6460
if: steps.changed-tasks.outputs.tasks_any_modified == 'true'
65-
run: python -m pytest tests/test_tasks.py -s -vv
61+
run: uv run pytest tests/test_tasks.py -s -vv
6662
# if api is modified, run tests on it
6763
- name: Test more tasks with pytest
6864
env:
6965
API: true
7066
if: steps.changed-tasks.outputs.api_any_modified == 'true'
71-
run: python -m pytest tests/test_tasks.py -s -vv
67+
run: uv run pytest tests/test_tasks.py -s -vv

.github/workflows/unit_tests.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@ jobs:
2222
steps:
2323
- name: Checkout Code
2424
uses: actions/checkout@v4
25-
- name: Set up Python 3.10
26-
uses: actions/setup-python@v5
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v7
2727
with:
28-
python-version: '3.10'
29-
cache: pip
30-
cache-dependency-path: pyproject.toml
28+
enable-cache: true
29+
python-version: "3.10"
3130
- name: Pre-Commit
3231
env:
3332
SKIP: "no-commit-to-branch,mypy"
@@ -44,12 +43,11 @@ jobs:
4443
steps:
4544
- name: Checkout Code
4645
uses: actions/checkout@v4
47-
- name: Set up Python ${{ matrix.python-version }}
48-
uses: actions/setup-python@v5
46+
- name: Install uv
47+
uses: astral-sh/setup-uv@v7
4948
with:
49+
enable-cache: true
5050
python-version: ${{ matrix.python-version }}
51-
cache: pip
52-
cache-dependency-path: pyproject.toml
5351

5452
# Cache HuggingFace cache directory for CPU tests
5553
- name: Cache HuggingFace cache (CPU tests)
@@ -63,12 +61,12 @@ jobs:
6361
6462
- name: Install dependencies
6563
run: |
66-
python -m pip install --upgrade pip
67-
pip install -e '.[dev,unitxt]' --extra-index-url https://download.pytorch.org/whl/cpu
68-
pip install hf_xet
64+
uv venv
65+
uv pip install -e '.[dev,unitxt]' --extra-index-url https://download.pytorch.org/whl/cpu
66+
uv pip install hf_xet
6967
7068
- name: Test with pytest
71-
run: python -m pytest --showlocals -s -vv -n=auto --ignore=tests/models/test_openvino.py --ignore=tests/models/test_hf_steered.py
69+
run: uv run pytest --showlocals -s -vv -n=auto --ignore=tests/models/test_openvino.py --ignore=tests/models/test_hf_steered.py
7270
continue-on-error: true # Continue workflow even if tests fail
7371

7472
# Save test artifacts

0 commit comments

Comments
 (0)