Skip to content

Commit e7785d7

Browse files
update CI/CD to use uv
1 parent 87351f4 commit e7785d7

File tree

6 files changed

+41
-31
lines changed

6 files changed

+41
-31
lines changed

.github/workflows/code_format.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,19 @@ jobs:
1818
- name: Checkout Repository
1919
uses: actions/checkout@v4
2020

21-
- name: Set up Python
22-
uses: actions/setup-python@v5
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v4
2323
with:
24-
python-version: '3.11'
25-
cache: 'pip' # caching pip dependencies
24+
enable-cache: true
25+
26+
- name: Set up Python
27+
run: uv python install 3.11
2628

27-
- name: Pip install
28-
run: pip install -r requirements.txt
29+
- name: Install dependencies
30+
run: uv sync --frozen
2931

30-
- name: Pip list
31-
run: pip list
32+
- name: List packages
33+
run: uv pip list
3234

3335
- name: Code Formatting
34-
run: black . --check --diff
36+
run: uv run black . --check --diff

.github/workflows/darglint.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@ jobs:
2222
uses: actions/setup-python@v5
2323
with:
2424
python-version: '3.12'
25-
cache: 'pip' # caching pip dependencies
2625

27-
- name: Pip install
26+
- name: Install darglint
2827
run: pip install darglint
2928

30-
- name: Pip list
29+
- name: List packages
3130
run: pip list
3231

3332
- name: Darglint checks

.github/workflows/python_version_compatibility.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,12 @@ jobs:
3232
- name: Check Python ${{ matrix.python-version }}
3333
continue-on-error: true
3434
run: |
35-
export PATH="$HOME/.cargo/bin:$PATH"
36-
if uvx --python ${{ matrix.python-version }} --from python --with-requirements requirements.txt python -c "print('✅ Compatible')"; then
37-
echo "✅ Python ${{ matrix.python-version }} works"
38-
else
39-
echo "❌ Python ${{ matrix.python-version }} incompatible"
40-
fi
35+
export PATH="$HOME/.cargo/bin:$PATH"
36+
uv python install ${{ matrix.python-version }}
37+
if uv sync --frozen --python ${{ matrix.python-version }}; then
38+
uv run -p ${{ matrix.python-version }} python -c "import sys; print('✅ Compatible:', sys.version)"
39+
echo "✅ Python ${{ matrix.python-version }} works"
40+
else
41+
echo "❌ Python ${{ matrix.python-version }} incompatible"
42+
exit 1
43+
fi

.github/workflows/unit_tests.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,25 @@ jobs:
2323
- name: Set up Git user
2424
run: git config --global user.email "[email protected]" && git config --global user.name "GitHub Actions"
2525

26+
- name: Install uv
27+
uses: astral-sh/setup-uv@v4
28+
with:
29+
enable-cache: true
30+
2631
- name: Set up Python
27-
uses: actions/setup-python@v5
28-
with: # python at least 3.11
29-
python-version: '3.11'
30-
cache: 'pip' # caching pip dependencies
32+
run: uv python install 3.11
3133

3234
- name: Install AgentLab
33-
run: pip install -e .
35+
run: uv sync --frozen
3436

35-
- name: Pip list
36-
run: pip list
37+
- name: List packages
38+
run: uv pip list
3739

3840
- name: Install Playwright
39-
run: playwright install chromium --with-deps
41+
run: uv run playwright install chromium --with-deps
4042

4143
- name: Download WebArena / VisualWebArena ressource files
42-
run: python -c 'import nltk; nltk.download("punkt_tab")'
44+
run: uv run python -c 'import nltk; nltk.download("punkt_tab")'
4345

4446
- name: Fetch MiniWob
4547
uses: actions/checkout@v4
@@ -59,9 +61,9 @@ jobs:
5961
run: curl -I "http://localhost:8080/miniwob/" || echo "MiniWob not reachable"
6062

6163
- name: Pre-download nltk ressources
62-
run: python -c "import nltk; nltk.download('punkt_tab')"
64+
run: uv run python -c "import nltk; nltk.download('punkt_tab')"
6365

6466
- name: Run AgentLab Unit Tests
6567
env:
6668
MINIWOB_URL: "http://localhost:8080/miniwob/"
67-
run: pytest -n 5 --durations=10 -m 'not pricy' -v tests/
69+
run: uv run pytest -n 5 --durations=10 -m 'not pricy' -v tests/

.readthedocs.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,8 @@ sphinx:
3232
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
3333
python:
3434
install:
35+
- method: pip
36+
path: .
37+
extra_requirements:
38+
- dev
3539
- requirements: docs/source/requirements.txt

docs/source/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
agentlab
2-
sphinx-rtd-theme
1+
sphinx-rtd-theme
2+
sphinx

0 commit comments

Comments
 (0)