@@ -32,13 +32,11 @@ jobs:
3232 fail-fast : false
3333 matrix :
3434 python_version :
35- - " 3.9"
3635 - " 3.10"
3736 - " 3.11"
3837 - " 3.12"
3938 - " 3.13"
4039 # cryptography is not compatible with older PyPy versions
41- - " pypy-3.9"
4240 - " pypy-3.10"
4341 os :
4442 - ubuntu-latest
@@ -49,28 +47,33 @@ jobs:
4947 uses : actions/setup-python@v6
5048 with :
5149 python-version : ${{ matrix.python_version }}
50+ - name : Install uv
51+ uses : astral-sh/setup-uv@v4
5252
5353 - name : Install OS / deb dependencies
5454 run : |
5555 sudo DEBIAN_FRONTEND=noninteractive apt-get update
5656 sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq gcc libvirt-dev
5757
58- - name : Cache Python Dependencies
58+ - name : Cache uv
5959 uses : actions/cache@v5
6060 with :
61- path : ~/.cache/pip
62- key : ${{ runner.os }}-pip -${{ hashFiles('requirements-tests.txt', ' ') }}
61+ path : ~/.cache/uv
62+ key : ${{ runner.os }}-uv -${{ hashFiles('uv.lock ') }}
6363 restore-keys : |
64- ${{ runner.os }}-pip -
64+ ${{ runner.os }}-uv -
6565
6666 - name : Install Python Dependencies
67- run : pip install -r requirements-ci.txt
67+ run : uv sync --extra ci
68+
69+ - name : Add .venv to PATH
70+ run : echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH"
6871
6972 - name : Run unit tests tox target
7073 run : tox -e py${{ matrix.python_version }}
7174
7275 - name : Run dist install checks tox target
73- if : ${{ matrix.python_version != 'pypy-3.9' && matrix.python_version != 'pypy-3. 10' }}
76+ if : ${{ matrix.python_version != 'pypy-3.10' }}
7477 run : tox -e py${{ matrix.python_version }}-dist,py${{ matrix.python_version }}-dist-wheel
7578
7679 code_coverage :
@@ -79,30 +82,35 @@ jobs:
7982
8083 strategy :
8184 matrix :
82- python_version : [ "3.10"]
85+ python_version : [ "3.10" ]
8386
8487 steps :
8588 - uses : actions/checkout@v6
8689 - name : Use Python ${{ matrix.python_version }}
8790 uses : actions/setup-python@v6
8891 with :
8992 python-version : ${{ matrix.python_version }}
93+ - name : Install uv
94+ uses : astral-sh/setup-uv@v4
9095
9196 - name : Install OS / deb dependencies
9297 run : |
9398 sudo DEBIAN_FRONTEND=noninteractive apt-get update
9499 sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq graphviz gcc libvirt-dev
95100
96- - name : Cache Python Dependencies
101+ - name : Cache uv
97102 uses : actions/cache@v5
98103 with :
99- path : ~/.cache/pip
100- key : ${{ runner.os }}-pip -${{ hashFiles('requirements-tests.txt ') }}
104+ path : ~/.cache/uv
105+ key : ${{ runner.os }}-uv -${{ hashFiles('uv.lock ') }}
101106 restore-keys : |
102- ${{ runner.os }}-pip -
107+ ${{ runner.os }}-uv -
103108
104109 - name : Install Python Dependencies
105- run : pip install -r requirements-ci.txt
110+ run : uv sync --extra ci
111+
112+ - name : Add .venv to PATH
113+ run : echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH"
106114
107115 - name : Run Checks
108116 run : tox -e coverage-ci
@@ -130,22 +138,27 @@ jobs:
130138 uses : actions/setup-python@v6
131139 with :
132140 python-version : ${{ matrix.python_version }}
141+ - name : Install uv
142+ uses : astral-sh/setup-uv@v4
133143
134144 - name : Install OS / deb dependencies
135145 run : |
136146 sudo DEBIAN_FRONTEND=noninteractive apt-get update
137147 sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq graphviz gcc libvirt-dev
138148
139- - name : Cache Python Dependencies
149+ - name : Cache uv
140150 uses : actions/cache@v5
141151 with :
142- path : ~/.cache/pip
143- key : ${{ runner.os }}-pip -${{ hashFiles('requirements-lint.txt ') }}
152+ path : ~/.cache/uv
153+ key : ${{ runner.os }}-uv -${{ hashFiles('uv.lock ') }}
144154 restore-keys : |
145- ${{ runner.os }}-pip -
155+ ${{ runner.os }}-uv -
146156
147157 - name : Install Python Dependencies
148- run : pip install -r requirements-ci.txt
158+ run : uv sync --extra ci
159+
160+ - name : Add .venv to PATH
161+ run : echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH"
149162
150163 - name : Run shellcheck
151164 run : shellcheck dist/*.sh contrib/*.sh
@@ -173,19 +186,25 @@ jobs:
173186 uses : actions/setup-python@v6
174187 with :
175188 python-version : ${{ matrix.python_version }}
189+ - name : Install uv
190+ uses : astral-sh/setup-uv@v4
191+ - name : Install OS / deb dependencies
192+ run : |
193+ sudo DEBIAN_FRONTEND=noninteractive apt-get update
194+ sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq gcc libvirt-dev pkg-config
176195
177- - name : Cache Python Dependencies
196+ - name : Cache uv
178197 uses : actions/cache@v5
179198 with :
180- path : ~/.cache/pip
181- key : ${{ runner.os }}-pip -${{ hashFiles('requirements-lint.txt ') }}
199+ path : ~/.cache/uv
200+ key : ${{ runner.os }}-uv -${{ hashFiles('uv.lock ') }}
182201 restore-keys : |
183- ${{ runner.os }}-pip -
202+ ${{ runner.os }}-uv -
184203
185204 - name : Install Python Dependencies
186205 run : |
187- pip install -r requirements-ci.txt
188- pip install "build==1.2.2 "
206+ uv sync --extra ci --extra build
207+ echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH "
189208
190209 - name : Build Release Artifact
191210 run : |
@@ -229,7 +248,7 @@ jobs:
229248 # Since wheel doesn't include those files, we need to manually copy them over from
230249 # repo root so we can run the tests
231250 cp ../../tox.ini .
232- cp ../../requirements-tests.txt .
251+ cp ../../pyproject.toml .
233252 cp ../../libcloud/test/secrets.py-dist libcloud/test/secrets.py-dist
234253 tox -c tox.ini -epy3.10
235254
@@ -262,26 +281,36 @@ jobs:
262281
263282 steps :
264283 - uses : actions/checkout@v6
265- - name : Install OS / deb dependencies
266- run : |
267- sudo DEBIAN_FRONTEND=noninteractive apt-get update
268- sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq gcc libvirt-dev
269-
270284 - name : Use Python ${{ matrix.python_version }}
271285 uses : actions/setup-python@v6
272286 with :
273287 python-version : ${{ matrix.python_version }}
288+ - name : Install uv
289+ uses : astral-sh/setup-uv@v4
274290
275- - name : Cache Python Dependencies
291+ - name : Install OS / deb dependencies
292+ run : |
293+ sudo DEBIAN_FRONTEND=noninteractive apt-get update
294+ sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq gcc libvirt-dev
295+
296+ - name : Cache uv
276297 uses : actions/cache@v5
277298 with :
278- path : ~/.cache/pip
279- key : ${{ runner.os }}-pip -${{ hashFiles('requirements-lint.txt ') }}
299+ path : ~/.cache/uv
300+ key : ${{ runner.os }}-uv -${{ hashFiles('uv.lock ') }}
280301 restore-keys : |
281- ${{ runner.os }}-pip -
302+ ${{ runner.os }}-uv -
282303
283304 - name : Install Python Dependencies
284- run : pip install -r requirements-ci.txt
305+ run : uv sync --extra ci
306+
307+ - name : Add .venv to PATH
308+ run : echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH"
309+
310+ - name : Ensure pip is available
311+ run : |
312+ python -m ensurepip --upgrade
313+ python -m pip install --upgrade pip
285314
286315 - name : Install Library Into Virtualenv
287316 run : |
@@ -304,10 +333,13 @@ jobs:
304333 - name : Cleanup
305334 run : rm -rf venv/ || true
306335
336+ - name : Export Development Requirements
337+ run : uv export --extra test --extra lint --extra mypy --extra docs --format requirements.txt --no-hashes --no-emit-project --output-file requirements-dev.txt
338+
307339 - name : Run Pip Audit Check On All Development And Test Dependencies
308340 uses : pypa/gh-action-pip-audit@1220774d901786e6f652ae159f7b6bc8fea6d266 # v1.1.0
309341 with :
310- inputs : requirements-tests.txt requirements-lint.txt requirements-mypy.txt requirements-docs .txt
342+ inputs : requirements-dev .txt
311343 # setuptools which we don't install or depend on directly
312344 ignore-vulns : |
313345 GHSA-r9hx-vwmv-q579
@@ -329,22 +361,27 @@ jobs:
329361 uses : actions/setup-python@v6
330362 with :
331363 python-version : ${{ matrix.python_version }}
364+ - name : Install uv
365+ uses : astral-sh/setup-uv@v4
332366
333367 - name : Install OS / deb dependencies
334368 run : |
335369 sudo DEBIAN_FRONTEND=noninteractive apt-get update
336370 sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq graphviz gcc libvirt-dev
337371
338- - name : Cache Python Dependencies
372+ - name : Cache uv
339373 uses : actions/cache@v5
340374 with :
341- path : ~/.cache/pip
342- key : ${{ runner.os }}-pip -${{ hashFiles('requirements-tests.txt ') }}
375+ path : ~/.cache/uv
376+ key : ${{ runner.os }}-uv -${{ hashFiles('uv.lock ') }}
343377 restore-keys : |
344- ${{ runner.os }}-pip -
378+ ${{ runner.os }}-uv -
345379
346380 - name : Install Python Dependencies
347- run : pip install -r requirements-ci.txt
381+ run : uv sync --extra ci
382+
383+ - name : Add .venv to PATH
384+ run : echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH"
348385
349386 - name : Run Micro Benchmarks
350387 run : tox -e micro-benchmarks
@@ -363,6 +400,8 @@ jobs:
363400 uses : actions/setup-python@v6
364401 with :
365402 python-version : ${{ matrix.python_version }}
403+ - name : Install uv
404+ uses : astral-sh/setup-uv@v4
366405
367406 - name : Print Environment Info
368407 run : printenv | sort
@@ -372,16 +411,19 @@ jobs:
372411 sudo DEBIAN_FRONTEND=noninteractive apt-get update
373412 sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq graphviz gcc libvirt-dev
374413
375- - name : Cache Python Dependencies
414+ - name : Cache uv
376415 uses : actions/cache@v5
377416 with :
378- path : ~/.cache/pip
379- key : ${{ runner.os }}-pip -${{ hashFiles('requirements-docs.txt ') }}
417+ path : ~/.cache/uv
418+ key : ${{ runner.os }}-uv -${{ hashFiles('uv.lock ') }}
380419 restore-keys : |
381- ${{ runner.os }}-pip -
420+ ${{ runner.os }}-uv -
382421
383422 - name : Install Python Dependencies
384- run : pip install -r requirements-ci.txt
423+ run : uv sync --extra ci
424+
425+ - name : Add .venv to PATH
426+ run : echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH"
385427
386428 - name : Build Docs
387429 run : tox -e docs
@@ -392,5 +434,5 @@ jobs:
392434 RTD_TOKEN : ${{ secrets.RTD_TOKEN }}
393435 BRANCH_NAME : " trunk"
394436 run : |
395- pip install requests
437+ python -m pip install requests
396438 python ./contrib/trigger_rtd_build.py
0 commit comments