Skip to content

Commit a0b1ea0

Browse files
committed
🔧 Switch to dependency groups
* Update readthedocs config * Update GitHub workflow
1 parent 3c6bbad commit a0b1ea0

File tree

5 files changed

+16
-22
lines changed

5 files changed

+16
-22
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
run: |
3737
uv venv
3838
echo "$PWD/.venv/bin" >> $GITHUB_PATH
39-
uv pip install -e ".[docs]"
39+
uv pip install --group=docs
4040
- name: Build HTML and check links
4141
run: |
4242
make html

.readthedocs.yaml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ build:
1313
- plantuml
1414
tools:
1515
python: "3.12"
16+
jobs:
17+
install:
18+
- python -m pip install --upgrade pip
19+
- python -m pip install --group=docs
1620

1721
# Build documentation in the docs/ directory with Sphinx
1822
sphinx:
@@ -22,11 +26,3 @@ sphinx:
2226
formats:
2327
- epub
2428
- pdf
25-
26-
# Optionally declare the Python requirements required to build your docs
27-
python:
28-
install:
29-
- method: pip
30-
path: .
31-
extra_requirements:
32-
- docs

docs/document/sphinx/test.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@ whether the documentation is being built and the links are valid. In
101101
[testenv:docs]
102102
# Keep base_python in sync with ci.yml and .readthedocs.yaml.
103103
base_python = py312
104-
extras = docs
104+
dependency_groups = docs
105105
commands =
106106
sphinx-build -n -T -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
107107
108108
[testenv:docs-linkcheck]
109109
base_python = {[testenv:docs]base_python}
110-
extras = {[testenv:docs]extras}
110+
dependency_groups = docs
111111
commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees docs docs/_build/html
112112
113113
You can then define the following jobs for GitHub, for example:

docs/test/tox.rst

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ Before you can run tox, you must ensure that you have installed tox-uv:
9999

100100
.. code-block:: console
101101
102-
$ uv sync --extra dev
102+
$ uv sync --group dev
103103
104104
.. tab:: Windows
105105

106106
.. code-block:: ps1con
107107
108-
C:> uv sync --extra dev
108+
C:> uv sync --group dev
109109
110110
To run tox, simply start tox:
111111

@@ -348,8 +348,7 @@ We can also call individual tests with tox by making another change so that
348348
skip_missing_interpreters = True
349349
350350
[testenv]
351-
extras =
352-
tests: tests
351+
dependency_groups = tests
353352
deps =
354353
tests: coverage[toml]
355354
allowlist_externals = coverage
@@ -564,17 +563,16 @@ You can install ``tox`` and ``tox-uv`` with:
564563

565564
If you want to use ``uv sync`` with a ``uv.lock`` file for a Tox environment,
566565
you must change the runner for this Tox environment to ``uv-venv-lock-runner``.
567-
You should also use the extras configuration in such environments to instruct
568-
``uv`` to install the specified extras, for example:
566+
You should also use the dependency_groups configuration in such environments
567+
to instruct ``uv`` to install the specified dependency group, for example:
569568

570569
.. code-block:: ini
571570
:caption: tox.ini
572571
573572
[testenv]
574573
runner = uv-venv-lock-runner
575-
extras =
576-
dev
574+
dependency_groups = dev
577575
commands = pytest
578576
579577
``dev`` uses the ``uv-venv-lock-runner`` and uses ``uv sync`` to install
580-
dependencies in the environment with the ``dev`` extras.
578+
dependencies in the environment with the ``dev`` dependency group.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ classifiers = [
1414
]
1515
dependencies = []
1616

17-
[project.optional-dependencies]
17+
[dependency-groups]
1818
docs = [
1919
"furo",
2020
"ipython",
@@ -31,7 +31,7 @@ docs = [
3131
]
3232

3333
dev = [
34-
"python-basics-tutorial[docs]",
34+
{ include-group = "docs" },
3535
"pre-commit",
3636
"codespell",
3737
"vale"

0 commit comments

Comments
 (0)