File tree Expand file tree Collapse file tree 4 files changed +70
-1
lines changed
Expand file tree Collapse file tree 4 files changed +70
-1
lines changed Original file line number Diff line number Diff line change 1+ name : Documentation
2+
3+ on :
4+ - pull_request
5+
6+ jobs :
7+ build-docs :
8+ runs-on : ubuntu-latest
9+
10+ steps :
11+ - uses : actions/checkout@v3
12+
13+ - name : Set up Python
14+ uses : actions/setup-python@v4
15+ with :
16+ python-version : " 3.11"
17+
18+ - name : Install Dependencies
19+ run : pip install -e . -r dev-requirements.txt
20+
21+ - name : Print installed packages
22+ run : pip freeze
23+
24+ - name : Build docs with Sphinx
25+ working-directory : ./docs/
26+ run : make html
27+
28+ - name : Check public API docs are complete
29+ working-directory : ./docs/
30+ run : python check_public_api.py
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ attrs==25.3.0
2222 # via
2323 # jsonschema
2424 # referencing
25+ # sphobjinv
2526autodocsumm == 0.2.14
2627 # via sphinx-toolbox
2728babel == 2.17.0
@@ -37,6 +38,7 @@ certifi==2025.7.14
3738 # requests
3839 # sentry-sdk
3940 # sphinx-prompt
41+ # sphobjinv
4042charset-normalizer == 3.4.2
4143 # via requests
4244click == 8.2.1
@@ -140,7 +142,9 @@ jinja2==3.1.6
140142 # sphinx-autoapi
141143 # sphinx-jinja2-compat
142144jsonschema == 4.24.1
143- # via labthings-fastapi (pyproject.toml)
145+ # via
146+ # labthings-fastapi (pyproject.toml)
147+ # sphobjinv
144148jsonschema-specifications == 2025.4.1
145149 # via jsonschema
146150markdown-it-py == 3.0.0
@@ -309,6 +313,8 @@ sphinxcontrib-qthelp==2.0.0
309313 # via sphinx
310314sphinxcontrib-serializinghtml == 2.0.0
311315 # via sphinx
316+ sphobjinv == 2.4
317+ # via labthings-fastapi (pyproject.toml)
312318starlette == 0.47.1
313319 # via fastapi
314320tabulate == 0.9.0
Original file line number Diff line number Diff line change 1+ """Check public API for completeness.
2+
3+ This module loads the intersphinx inventory, and checks that all the symbols from the
4+ top-level module are present. This should prevent that page from going out of date.
5+ """
6+
7+ import sphobjinv as soi
8+
9+ import labthings_fastapi as lt
10+
11+ if __name__ == "__main__" :
12+ inventory = soi .Inventory ("build/html/objects.inv" )
13+
14+ if not inventory .project == "labthings-fastapi" :
15+ raise AssertionError (f"The inventory is for { inventory .project } not LabThings!" )
16+
17+ published_lt_namespace = {}
18+
19+ for object in inventory .objects :
20+ if object .name .startswith ("lt." ) and object .domain == "py" :
21+ published_lt_namespace [object .name ] = object
22+
23+ missing = []
24+
25+ for name in lt .__all__ :
26+ if f"lt.{ name } " not in published_lt_namespace :
27+ missing .append (name )
28+
29+ if missing :
30+ msg = "Failure: the following symbols are missing from the `lt` namespace: \n \n "
31+ msg += "\n " .join (missing )
32+ raise AssertionError (msg )
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ dev = [
4141 " sphinx>=7.2" ,
4242 " sphinx-autoapi" ,
4343 " sphinx-toolbox" ,
44+ " sphobjinv" ,
4445 " tomli; python_version < '3.11'" ,
4546 " codespell" ,
4647]
You can’t perform that action at this time.
0 commit comments