Skip to content

Commit cd6bee3

Browse files
authored
[OPIK-7385] [GHA] chore: migrate CI Python tooling from pip/setup-python to uv (#7538)
1 parent 6e9d0e0 commit cd6bee3

44 files changed

Lines changed: 256 additions & 156 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/install_opik_and_run_e2e_lib_integration_tests/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ runs:
2626
2727
echo "Installing test dependencies"
2828
cd ./tests
29-
uv pip install --no-cache-dir --disable-pip-version-check -r test_requirements.txt
30-
uv pip install --no-cache-dir --disable-pip-version-check -r e2e_library_integration/${{ inputs.library_name }}/requirements.txt
29+
uv pip install -r test_requirements.txt
30+
uv pip install -r e2e_library_integration/${{ inputs.library_name }}/requirements.txt
3131
uv pip list
3232
3333
echo "Running tests"

.github/workflows/code_quality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ jobs:
157157
working-directory: sdks/typescript
158158

159159
- name: Set up uv
160-
uses: astral-sh/setup-uv@v5
160+
uses: astral-sh/setup-uv@v8.3.2
161161

162162
- name: Cache pre-commit environments
163163
uses: actions/cache@v4

.github/workflows/deploy_python_sdk_docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
show-progress: false
4242

4343
- name: Setup uv
44-
uses: astral-sh/setup-uv@v8.2.0
44+
uses: astral-sh/setup-uv@v8.3.2
4545

4646
- name: Build Python SDK docs
4747
run: |

.github/workflows/documentation_cookbook_tests.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,14 @@ jobs:
4040
- uses: actions/setup-python@v5
4141
with:
4242
python-version: ${{ matrix.python-version }}
43-
- name: Get pip cache dir
44-
id: pip-cache
45-
run: |
46-
echo "dir=$(pip cache dir)" >> "$GITHUB_OUTPUT"
47-
- name: pip cache
48-
uses: actions/cache@v4
49-
with:
50-
path: ${{ steps.pip-cache.outputs.dir }}
51-
key: ${{ matrix.os }}-${{ matrix.python-version }}-pip
52-
restore-keys: |
53-
${{ matrix.os }}-${{ matrix.python-version }}-pip
43+
- name: Set up uv
44+
uses: astral-sh/setup-uv@v8.3.2
5445
- name: Install dependencies
5546
run: |
56-
python -m pip install --upgrade pip
57-
python -m pip install -U ipython nbconvert
47+
uv pip install --system -U ipython nbconvert
5848
- name: Install opik from source files (optional)
5949
if: ${{ github.event_name == 'workflow_dispatch' && inputs.install_opik == 'true' }}
60-
run: pip install sdks/python
50+
run: uv pip install --system sdks/python
6151
- name: Prepare env variables
6252
run: |
6353
directory=$(dirname -- "${NOTEBOOK_TO_TEST}")

.github/workflows/e2e_tests_post_merge_v2.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,11 @@ jobs:
9191
cache: 'npm'
9292
cache-dependency-path: tests_end_to_end/e2e/package-lock.json
9393

94-
- name: "🐍 Setup Python"
95-
uses: actions/setup-python@v5
94+
- name: "🐍 Setup uv & Python"
95+
uses: astral-sh/setup-uv@v8.3.2
9696
with:
9797
python-version: '3.12'
9898

99-
- name: "⚡ Setup uv"
100-
uses: astral-sh/setup-uv@v5
101-
10299
- name: "📚 Install E2E test dependencies"
103100
working-directory: tests_end_to_end/e2e
104101
run: |

.github/workflows/end2end_suites_v2.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,11 @@ jobs:
6262
cache: 'npm'
6363
cache-dependency-path: tests_end_to_end/e2e/package-lock.json
6464

65-
- name: Setup Python
66-
uses: actions/setup-python@v5
65+
- name: Setup uv & Python
66+
uses: astral-sh/setup-uv@v8.3.2
6767
with:
6868
python-version: '3.12'
6969

70-
- name: Setup uv
71-
uses: astral-sh/setup-uv@v5
72-
7370
- name: Install E2E test dependencies
7471
working-directory: ${{ github.workspace }}/tests_end_to_end/e2e
7572
run: |

.github/workflows/guardrails_e2e_tests.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ jobs:
7474
with:
7575
python-version: ${{matrix.python_version}}
7676

77+
- name: Set up uv
78+
uses: astral-sh/setup-uv@v8.3.2
79+
7780
- name: Run latest Opik server with guardrails
7881
env:
7982
OPIK_USAGE_REPORT_ENABLED: false
@@ -96,13 +99,13 @@ jobs:
9699
- name: Install opik SDK
97100
run: |
98101
cd ${{ github.workspace }}/sdks/python
99-
pip install .
102+
uv pip install --system .
100103
101104
- name: Install test requirements
102105
run: |
103106
cd ${{ github.workspace }}/sdks/python
104-
pip install -r tests/test_requirements.txt
105-
pip list
107+
uv pip install --system -r tests/test_requirements.txt
108+
uv pip list --system
106109
107110
- name: Run guardrails E2E tests
108111
run: |

.github/workflows/guardrails_unit_tests.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@ jobs:
4040
uses: actions/setup-python@v5
4141
with:
4242
python-version: '3.10'
43-
cache: 'pip'
43+
44+
- name: Set up uv
45+
uses: astral-sh/setup-uv@v8.3.2
4446

4547
- name: Install dependencies
4648
run: |
47-
python -m pip install --upgrade pip
48-
pip install -r requirements.txt -r tests/test_requirements.txt
49+
uv pip install --system -r requirements.txt -r tests/test_requirements.txt
4950
5051
- name: Run unit tests
5152
run: |

.github/workflows/installation_tests.yml

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@ jobs:
2323
with:
2424
python-version: 3.12
2525

26+
- name: Set up uv
27+
uses: astral-sh/setup-uv@v8.3.2
28+
2629
- name: Install Python dependencies
2730
run: |
28-
pip install -r ${{ github.workspace }}/tests_end_to_end/test_requirements.txt
29-
pip install opik
31+
uv pip install --system -r ${{ github.workspace }}/tests_end_to_end/test_requirements.txt
32+
uv pip install --system opik
3033
playwright install chromium
3134
3235
- name: Install using opik.sh
@@ -65,10 +68,13 @@ jobs:
6568
with:
6669
python-version: '3.12'
6770

71+
- name: Set up uv
72+
uses: astral-sh/setup-uv@v8.3.2
73+
6874
- name: Install Python dependencies
6975
run: |
70-
pip install -r ${{ github.workspace }}/tests_end_to_end/test_requirements.txt
71-
pip install opik
76+
uv pip install --system -r ${{ github.workspace }}/tests_end_to_end/test_requirements.txt
77+
uv pip install --system opik
7278
playwright install chromium
7379
7480
- name: Install using docker compose up --detach
@@ -119,10 +125,13 @@ jobs:
119125
with:
120126
python-version: '3.12'
121127

128+
- name: Set up uv
129+
uses: astral-sh/setup-uv@v8.3.2
130+
122131
- name: Install Python dependencies
123132
run: |
124-
pip install -r ${{ github.workspace }}/tests_end_to_end/test_requirements.txt
125-
pip install opik
133+
uv pip install --system -r ${{ github.workspace }}/tests_end_to_end/test_requirements.txt
134+
uv pip install --system opik
126135
playwright install chromium
127136
128137
- name: Install with --build flag
@@ -173,10 +182,13 @@ jobs:
173182
with:
174183
python-version: '3.12'
175184

185+
- name: Set up uv
186+
uses: astral-sh/setup-uv@v8.3.2
187+
176188
- name: Install Python dependencies
177189
run: |
178-
pip install -r ${{ github.workspace }}/tests_end_to_end/test_requirements.txt
179-
pip install opik
190+
uv pip install --system -r ${{ github.workspace }}/tests_end_to_end/test_requirements.txt
191+
uv pip install --system opik
180192
playwright install chromium
181193
182194
- name: Install with docker compose with specific version set
@@ -228,10 +240,13 @@ jobs:
228240
with:
229241
python-version: '3.12'
230242

243+
- name: Set up uv
244+
uses: astral-sh/setup-uv@v8.3.2
245+
231246
- name: Install Python dependencies
232247
run: |
233-
pip install -r ${{ github.workspace }}/tests_end_to_end/test_requirements.txt
234-
pip install opik
248+
uv pip install --system -r ${{ github.workspace }}/tests_end_to_end/test_requirements.txt
249+
uv pip install --system opik
235250
playwright install chromium
236251
237252
- name: Install with docker compose after pulling latest version

.github/workflows/lib-adk-legacy-1-3-0-tests.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,21 @@ jobs:
4848
with:
4949
python-version: ${{matrix.python_version}}
5050

51+
- name: Set up uv
52+
uses: astral-sh/setup-uv@v8.3.2
53+
5154
- name: Install opik
52-
run: pip install .
55+
run: uv pip install --system .
5356

5457
- name: Install test tools
5558
run: |
5659
cd ./tests
57-
pip install --no-cache-dir --disable-pip-version-check -r test_requirements.txt
60+
uv pip install --system -r test_requirements.txt
5861
5962
- name: Install lib
6063
run: |
6164
cd ./tests
62-
pip install --no-cache-dir --disable-pip-version-check -r library_integration/adk/requirements_legacy_adk_1_3_0.txt
65+
uv pip install --system -r library_integration/adk/requirements_legacy_adk_1_3_0.txt
6366
6467
- name: Authenticate to Google Cloud
6568
uses: google-github-actions/auth@v2

0 commit comments

Comments
 (0)