Skip to content

Commit a537207

Browse files
committed
Switch docs action to use sphinxutils.
1 parent d92d897 commit a537207

10 files changed

Lines changed: 40 additions & 25 deletions

File tree

.github/workflows/build_docs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Python
1919
uses: actions/setup-python@v6
2020
with:
21-
python-version: '3.11'
21+
python-version: '3.13'
2222
cache: "pip"
2323
cache-dependency-path: "setup.cfg"
2424

@@ -36,7 +36,7 @@ jobs:
3636
run: uv pip install --system --no-deps -v .
3737

3838
- name: Install documenteer
39-
run: uv pip install --system 'documenteer[pipelines]==0.8.2' sphinx-automodapi==0.19 sphinx-prompt==1.6.0
39+
run: uv pip install --system -r doc/requirements.txt
4040

4141
- name: Build documentation
4242
working-directory: ./doc

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ instance/
7373

7474
# Sphinx documentation
7575
docs/_build/
76+
doc/api
7677

7778
# PyBuilder
7879
target/

doc/changes/DM-54006.misc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Bumped minimum Python version to 3.12. Dropped ``black`` and ``isort`` sections from ``pyproject.toml``.
1+
Bumped minimum Python version to 3.12. Dropped ``black`` and ``isort`` sections from ``pyproject.toml``. Switched docs action to use ``sphinxutils``.

doc/conf.py

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,8 @@
33
This configuration only affects single-package Sphinx documentation builds.
44
"""
55

6-
from documenteer.conf.pipelinespkg import * # noqa: F403, import *
6+
# ruff: noqa: F403, F405
77

8-
project = "ctrl_bps"
9-
html_theme_options["logotext"] = project # noqa: F405, unknown name
10-
html_title = project
11-
html_short_title = project
12-
doxylink = {}
13-
exclude_patterns = ["changes/*"]
8+
from documenteer.conf.guide import *
149

15-
# Try to pull in links for butler and pipe_base.
16-
intersphinx_mapping["lsst"] = ("https://pipelines.lsst.io/v/daily/", None) # noqa
17-
intersphinx_mapping["networkx"] = ("https://networkx.org/documentation/stable/", None) # noqa: F405
18-
19-
# As a temporary hack until we move to documenteer 2 delete scipy
20-
# (since it no longer works)
21-
try:
22-
del intersphinx_mapping["scipy"] # noqa: F405
23-
except KeyError:
24-
pass
10+
exclude_patterns.append("changes/*")

doc/documenteer.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[project]
2+
title = "lsst-ctrl-bps"
3+
4+
[project.python]
5+
package = "lsst-ctrl-bps"
6+
7+
[build]
8+
clean = true
9+
10+
[sphinx]
11+
extensions = [
12+
"sphinx_click"
13+
]
14+
15+
[sphinx.intersphinx.projects]
16+
astropy = "https://docs.astropy.org/en/stable"
17+
python = "https://docs.python.org/3"
18+
lsst = "https://pipelines.lsst.io/v/daily/"
19+
click = "https://click.palletsprojects.com/en/stable"
20+
networkx = "https://networkx.org/documentation/stable/"

doc/lsst.ctrl.bps/quickstart.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
User Guide
2+
==========
3+
14
Overview
25
--------
36

doc/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
documenteer[guide] > 2.0, <3.0
2+
lsst-sphinxutils @ git+https://github.com/lsst/sphinxutils@main
3+
sphinx-click

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ dynamic = ["version"]
3737

3838
[project.urls]
3939
"Homepage" = "https://github.com/lsst/ctrl_bps"
40-
[project.optional-dependencies]
40+
"Source" = "https://github.com/lsst/ctrl_bps"
4141

42+
[project.optional-dependencies]
4243
test = [
4344
"pytest >= 3.2",
4445
"pytest-openfiles >= 0.5.0"
@@ -190,6 +191,7 @@ checks = [
190191
"RT01", # Unfortunately our @property trigger this.
191192
"RT02", # Does not want named return value. DM style says we do.
192193
"SS05", # pydocstyle is better at finding infinitive verb.
194+
"RT03", # Temporarily disable for sphinx empty returns.
193195
]
194196
exclude = [
195197
'^test_.*', # Do not test docstrings in test code.

python/lsst/ctrl/bps/bps_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def get(self, key, default=""):
197197
----------
198198
key : `str`
199199
Key to look for in config.
200-
default : Any, optional
200+
default : `~typing.Any`, optional
201201
Default value to return if the key is not in the config.
202202
203203
Returns

python/lsst/ctrl/bps/generic_workflow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ def add_node(self, node_for_adding: GenericWorkflowNode, **attr: Any) -> None:
490490
----------
491491
node_for_adding : `lsst.ctrl.bps.GenericWorkflowJob`
492492
Job to be added to generic workflow.
493-
**attr
493+
**attr : `~typing.Any`
494494
Needed to match original networkx function, but not used.
495495
"""
496496
self.add_job(node_for_adding)
@@ -524,7 +524,7 @@ def add_edges_from(self, ebunch_to_add: Iterable[tuple[str, str]], **attr: Any)
524524
ebunch_to_add : Iterable [`tuple` [`str`, `str`]]
525525
Iterable of job name pairs between which a dependency should be
526526
saved.
527-
**attr : keyword arguments, optional
527+
**attr : `~typing.Any`
528528
Data can be assigned using keyword arguments (not currently used).
529529
"""
530530
for edge_to_add in ebunch_to_add:
@@ -539,7 +539,7 @@ def add_edge(self, u_of_edge: str, v_of_edge: str, **attr: Any) -> None:
539539
Name of parent job.
540540
v_of_edge : `str`
541541
Name of child job.
542-
**attr : keyword arguments, optional
542+
**attr
543543
Attributes to save with edge.
544544
"""
545545
if u_of_edge not in self:

0 commit comments

Comments
 (0)