Skip to content

Commit

Permalink
docs: use dependency groups for deps
Browse files Browse the repository at this point in the history
- This makes it consistent with other dev deps.
- Uses partial jobs override introduced in
  readthedocs/readthedocs.org#11710
  • Loading branch information
nijel committed Nov 26, 2024
1 parent 2ba76da commit 99da751
Show file tree
Hide file tree
Showing 8 changed files with 549 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
sudo apt update
sudo apt install -y graphviz
- name: Install Python dependencies
run: uv pip install --system -r docs/requirements.txt
run: uv sync --no-sources --only-group docs --frozen
- name: Sphinx build
run: |
echo "::add-matcher::.github/matchers/sphinx.json"
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/linkcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ on:
push:
paths:
- docs/**.rst
- docs/requirements.txt
- .github/workflows/linkcheck.yml
pull_request:
paths:
- docs/**.rst
- docs/requirements.txt
- .github/workflows/linkcheck.yml
schedule:
- cron: 30 5 * * *
Expand All @@ -38,8 +36,7 @@ jobs:
sudo apt update
sudo apt install -y graphviz
- name: Install Python dependencies
run: |
uv pip install --system -r docs/requirements.txt
run: uv sync --no-sources --only-group docs --frozen
- name: Sphinx linkcheck
run: |
./ci/run-docs linkcheck
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ jobs:
sudo apt update
sudo apt install -y graphviz pandoc
- name: Install Python dependencies
run: uv pip install --system -r docs/requirements.txt
run: uv sync --no-sources --only-group docs --frozen
- name: Sphinx build
run: ./ci/run-docs
- name: Convert release notes
Expand Down
15 changes: 10 additions & 5 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,16 @@ build:
apt_packages:
# Graphviz is needed for sphinx.ext.graphviz
- graphviz

# Optionally set the version of Python and requirements required to build your docs
python:
install:
- requirements: docs/requirements.txt
jobs:
create_environment:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
install:
- uv sync --no-sources --only-group docs --frozen
build:
html:
- .venv/bin/sphinx-build -T -b html -d docs/_build/doctrees -D language=$READTHEDOCS_LANGUAGE docs $READTHEDOCS_OUTPUT/html

# Avoid cloning submodules
submodules:
Expand Down
5 changes: 3 additions & 2 deletions docs/contributing/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ Please respect these guidelines while writing:
2. Once the rewrite is reviewed, polished, and merged, change the structure of the paragraphs in another PR.

Documentation can be also edited and built locally, the Python requirements are
in `docs/requirements.txt`. You will also need :program:`graphviz` to build the
documentation.
in the ``docs`` dependency group in :file:`pyproject.toml`.

You will also need :program:`graphviz` to build the documentation.

.. hint::

Expand Down
11 changes: 0 additions & 11 deletions docs/requirements.txt

This file was deleted.

14 changes: 14 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,24 @@ dev = [
"reuse==5.0.2",
"scour==0.38.2",
"tinyunicodeblock==1.3",
{include-group = "docs"},
{include-group = "lint"},
{include-group = "test"},
{include-group = "types"}
]
docs = [
"furo==2024.8.6",
"jinja2>=3.1.4",
"matplotlib==3.9.2",
"pillow>=10.3.0",
"pygments==2.18.0",
"requests>=2.32.0",
"Sphinx==8.1.3",
"sphinx-copybutton==0.5.2",
"sphinx-jsonschema==1.19.1",
"sphinxcontrib-httpdomain==1.8.1",
"sphinxext-opengraph==0.9.1"
]
lint = [
{include-group = "pylint"},
{include-group = "pre-commit"}
Expand Down
519 changes: 519 additions & 0 deletions uv.lock

Large diffs are not rendered by default.

0 comments on commit 99da751

Please sign in to comment.