Skip to content

Commit bf6b29b

Browse files
authored
Move dev deps from extras to uv dependency groups (#2102)
1 parent 1422927 commit bf6b29b

File tree

13 files changed

+225
-141
lines changed

13 files changed

+225
-141
lines changed

.github/workflows/integration-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
- name: Install OS / deb dependencies
4545
run: |
4646
sudo DEBIAN_FRONTEND=noninteractive apt-get update
47-
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq gcc libvirt-dev
47+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq gcc libvirt-dev pkg-config
4848
4949
- name: Cache uv
5050
uses: actions/cache@v5
@@ -56,7 +56,7 @@ jobs:
5656
5757
- name: Install Python Dependencies
5858
run: |
59-
uv sync --extra ci
59+
uv sync --group ci --no-dev
6060
echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH"
6161
6262
- name: Run tox target

.github/workflows/main.yml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
- name: Install OS / deb dependencies
5454
run: |
5555
sudo DEBIAN_FRONTEND=noninteractive apt-get update
56-
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq gcc libvirt-dev
56+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq gcc libvirt-dev pkg-config
5757
5858
- name: Cache uv
5959
uses: actions/cache@v5
@@ -64,7 +64,7 @@ jobs:
6464
${{ runner.os }}-uv-
6565
6666
- name: Install Python Dependencies
67-
run: uv sync --extra ci
67+
run: uv sync --group ci --no-dev
6868

6969
- name: Add .venv to PATH
7070
run: echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH"
@@ -96,7 +96,7 @@ jobs:
9696
- name: Install OS / deb dependencies
9797
run: |
9898
sudo DEBIAN_FRONTEND=noninteractive apt-get update
99-
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq graphviz gcc libvirt-dev
99+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq graphviz gcc libvirt-dev pkg-config
100100
101101
- name: Cache uv
102102
uses: actions/cache@v5
@@ -107,7 +107,7 @@ jobs:
107107
${{ runner.os }}-uv-
108108
109109
- name: Install Python Dependencies
110-
run: uv sync --extra ci
110+
run: uv sync --group ci --no-dev
111111

112112
- name: Add .venv to PATH
113113
run: echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH"
@@ -144,7 +144,7 @@ jobs:
144144
- name: Install OS / deb dependencies
145145
run: |
146146
sudo DEBIAN_FRONTEND=noninteractive apt-get update
147-
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq graphviz gcc libvirt-dev
147+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq graphviz gcc libvirt-dev pkg-config
148148
149149
- name: Cache uv
150150
uses: actions/cache@v5
@@ -155,7 +155,7 @@ jobs:
155155
${{ runner.os }}-uv-
156156
157157
- name: Install Python Dependencies
158-
run: uv sync --extra ci
158+
run: uv sync --group ci --no-dev
159159

160160
- name: Add .venv to PATH
161161
run: echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH"
@@ -203,7 +203,7 @@ jobs:
203203
204204
- name: Install Python Dependencies
205205
run: |
206-
uv sync --extra ci --extra build
206+
uv sync --group ci --group build --no-dev
207207
echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH"
208208
209209
- name: Build Release Artifact
@@ -291,7 +291,7 @@ jobs:
291291
- name: Install OS / deb dependencies
292292
run: |
293293
sudo DEBIAN_FRONTEND=noninteractive apt-get update
294-
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq gcc libvirt-dev
294+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq gcc libvirt-dev pkg-config
295295
296296
- name: Cache uv
297297
uses: actions/cache@v5
@@ -302,7 +302,7 @@ jobs:
302302
${{ runner.os }}-uv-
303303
304304
- name: Install Python Dependencies
305-
run: uv sync --extra ci
305+
run: uv sync --group dev --group docs
306306

307307
- name: Add .venv to PATH
308308
run: echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH"
@@ -333,13 +333,10 @@ jobs:
333333
- name: Cleanup
334334
run: rm -rf venv/ || true
335335

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-
339336
- name: Run Pip Audit Check On All Development And Test Dependencies
340337
uses: pypa/gh-action-pip-audit@1220774d901786e6f652ae159f7b6bc8fea6d266 # v1.1.0
341338
with:
342-
inputs: requirements-dev.txt
339+
virtual-environment: .venv
343340
# setuptools which we don't install or depend on directly
344341
ignore-vulns: |
345342
GHSA-r9hx-vwmv-q579
@@ -367,7 +364,7 @@ jobs:
367364
- name: Install OS / deb dependencies
368365
run: |
369366
sudo DEBIAN_FRONTEND=noninteractive apt-get update
370-
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq graphviz gcc libvirt-dev
367+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq graphviz gcc libvirt-dev pkg-config
371368
372369
- name: Cache uv
373370
uses: actions/cache@v5
@@ -378,7 +375,7 @@ jobs:
378375
${{ runner.os }}-uv-
379376
380377
- name: Install Python Dependencies
381-
run: uv sync --extra ci
378+
run: uv sync --group ci --no-dev
382379

383380
- name: Add .venv to PATH
384381
run: echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH"
@@ -409,7 +406,7 @@ jobs:
409406
- name: Install OS / deb dependencies
410407
run: |
411408
sudo DEBIAN_FRONTEND=noninteractive apt-get update
412-
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq graphviz gcc libvirt-dev
409+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq graphviz gcc libvirt-dev pkg-config
413410
414411
- name: Cache uv
415412
uses: actions/cache@v5
@@ -420,7 +417,7 @@ jobs:
420417
${{ runner.os }}-uv-
421418
422419
- name: Install Python Dependencies
423-
run: uv sync --extra ci
420+
run: uv sync --group ci --no-dev
424421

425422
- name: Add .venv to PATH
426423
run: echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH"

.github/workflows/publish_dev_artifact.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
run: printenv | sort
3636
- name: Install Dependencies
3737
run: |
38-
uv sync --extra build
38+
uv sync --group build --no-dev
3939
echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH"
4040
4141
- name: Create Dev Artifacts

.github/workflows/publish_pricing_to_s3.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
- name: Install Python Dependencies
3535
run: |
36-
uv sync --extra ci
36+
uv sync --group ci --no-dev
3737
echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH"
3838
3939
- name: Generate and publish pricing data

.readthedocs.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ build:
99
os: ubuntu-22.04
1010
tools:
1111
python: "3.10"
12+
jobs:
13+
pre_create_environment:
14+
- python -m pip install --upgrade pip uv
15+
create_environment:
16+
- python -m uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
17+
install:
18+
- UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" python -m uv sync --frozen --group docs --no-dev
1219

1320
# Build documentation in the "docs/" directory with Sphinx
1421
sphinx:
@@ -20,12 +27,3 @@ formats:
2027

2128
# NOTE: We need to use older version of sphinx otherwise bullet points won't be rendered correctly
2229
# on RTD using rtd theme.
23-
# Optional but recommended, declare the Python requirements required
24-
# to build your documentation
25-
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
26-
python:
27-
install:
28-
- method: pip
29-
path: .
30-
extra_requirements:
31-
- rtd

docs/committer_guide.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ To run it:
108108
.. sourcecode:: bash
109109

110110
# Install build dependencies
111-
pip install -e ".[build]"
111+
uv sync --group build --no-dev
112112

113113
cd dist
114114
./release.sh -u <yourusername>@apache.org
@@ -193,7 +193,7 @@ use this token, see:
193193
.. sourcecode:: bash
194194

195195
# Install publish dependencies
196-
pip install -e ".[publish]"
196+
uv sync --group publish --no-dev
197197

198198
cd dist
199199
./deploy.sh

docs/development.rst

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ Getting started with contributing to Libcloud
1818
---------------------------------------------
1919

2020
We use ``uv`` to lock and manage development dependencies. Dependency groups are
21-
defined as extras in ``pyproject.toml`` and the ``uv.lock`` file replaces the
22-
legacy ``requirements-*.txt`` files.
21+
defined under ``[dependency-groups]`` in ``pyproject.toml`` and ``uv.lock`` is
22+
the source of truth for local development and documentation tooling.
2323

2424
To create or update the lockfile, run:
2525

@@ -30,17 +30,24 @@ To create or update the lockfile, run:
3030
If ``uv lock`` fails while building ``libvirt-python``, install the system
3131
dependencies (``pkg-config`` and ``libvirt-dev``).
3232

33-
To set up a local development environment with common tooling:
33+
To set up a local development environment with common tooling (tests, linting,
34+
type checking, tox):
3435

3536
.. sourcecode:: bash
3637

37-
uv sync --extra test --extra lint --extra docs --extra mypy --extra ci
38+
uv sync --group dev
3839

39-
If you only need a subset, sync just those extras (for example, tests only):
40+
If you only need a subset, sync just those groups (for example, tests only):
4041

4142
.. sourcecode:: bash
4243

43-
uv sync --extra test
44+
uv sync --group test --no-dev
45+
46+
If you also work on documentation, add the docs group:
47+
48+
.. sourcecode:: bash
49+
50+
uv sync --group dev --group docs
4451

4552
Commit ``uv.lock`` whenever dependency versions change.
4653

@@ -447,7 +454,7 @@ Some examples which show how to handle those cases are described below.
447454
Type annotation for unions
448455
~~~~~~~~~~~~~~~~
449456

450-
In Python 3.9 and below, the pipe character (``|``) cannot be used for union
457+
In Python 3.9 and below, the pipe character (``|``) cannot be used for union
451458
types in type annotations. Instead, you should use ``Union`` from the ``typing``
452459
module:
453460

docs/testing.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ If you use ``uv``, you can install all test dependencies in one step:
1616

1717
.. sourcecode:: bash
1818

19-
uv sync --extra test --extra ci
19+
uv sync --group test --group ci --no-dev
2020

21-
Drop ``--extra ci`` if you don't plan to run ``tox``.
21+
Drop ``--group ci`` if you don't plan to run ``tox``.
2222
If ``uv.lock`` is missing or out of date, run ``uv lock`` first.
2323

24-
If you don't use ``uv``, you need to have the following extra dependencies
24+
If you don't use ``uv``, you need to have the following additional dependencies
2525
installed:
2626

2727
* ``tox`` (``pip install tox``) - you only need this library if you want to

integration/compute/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Running the API service
88

99
.. code-block:: bash
1010
11-
uv sync --extra integration-compute
11+
uv sync --group integration-compute
1212
python -m integration.compute.api
1313
1414
Running the tests

integration/storage/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Setting up the test suite
88

99
.. code-block:: bash
1010
11-
uv sync --extra integration-storage
11+
uv sync --group integration-storage
1212
1313
Running the tests
1414
-----------------

0 commit comments

Comments
 (0)