Skip to content

Commit e77cb11

Browse files
authored
Merge pull request #133 from dihm/sphinx_updates
Update sphinx build and ensure RTD stable versioning is correct
2 parents 7bc5bb6 + 3db188b commit e77cb11

File tree

7 files changed

+36
-11
lines changed

7 files changed

+36
-11
lines changed

docs/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,18 @@ SPHINXOPTS ?=
77
SPHINXBUILD ?= sphinx-build
88
SOURCEDIR = source
99
BUILDDIR = build
10+
AUTOSUMMARYDIR = source/devices/_apidoc
1011

1112
# Put it first so that "make" without argument is like "make help".
1213
help:
1314
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
1415

15-
.PHONY: help Makefile
16+
clean:
17+
@echo "Removing apidoc directory"
18+
@rm -rf $(AUTOSUMMARYDIR)
19+
@$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
20+
21+
.PHONY: help clean Makefile
1622

1723
# Catch-all target: route all unknown targets to Sphinx using the new
1824
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).

docs/make.bat

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ if "%SPHINXBUILD%" == "" (
99
)
1010
set SOURCEDIR=source
1111
set BUILDDIR=build
12+
set AUTOSUMMARYDIR=source\devices\_apidoc
1213

1314
if "%1" == "" goto help
15+
if "%1" == "clean" goto clean
1416

1517
%SPHINXBUILD% >NUL 2>NUL
1618
if errorlevel 9009 (
@@ -30,6 +32,12 @@ goto end
3032

3133
:help
3234
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
35+
goto end
36+
37+
:clean
38+
echo Removing autosummary directory
39+
rmdir /s/q %AUTOSUMMARYDIR%
40+
%SPHINXBUILD% -M clean %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
3341

3442
:end
3543
popd

docs/source/conf.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import os
1414
from pathlib import Path
1515
from jinja2 import FileSystemLoader, Environment
16+
import importlib.metadata
1617

1718
# -- Project information (unique to each project) -------------------------------------
1819

@@ -21,7 +22,7 @@
2122
author = "labscript suite contributors"
2223

2324
# The full version, including alpha/beta/rc tags
24-
from labscript_devices import __version__ as version # noqa: E402
25+
version = importlib.metadata.version('labscript-devices')
2526

2627
release = version
2728

@@ -49,7 +50,7 @@
4950

5051
autodoc_typehints = 'description'
5152
autoclass_content = 'both' # options: 'both', 'class', 'init'
52-
autodoc_mock_imports = ['PyDAQmx','labscript_utils']
53+
autodoc_mock_imports = ['PyDAQmx','labscript_utils.h5_lock']
5354

5455
# Prefix each autosectionlabel with the name of the document it is in and a colon
5556
autosectionlabel_prefix_document = True
@@ -64,7 +65,10 @@
6465
exclude_patterns = []
6566

6667
# The suffix(es) of source filenames.
67-
source_suffix = ['.rst', '.md']
68+
source_suffix = {
69+
'.rst': 'restructuredtext',
70+
'.md': 'markdown',
71+
}
6872

6973
# The master toctree document.
7074
master_doc = 'index'
@@ -85,7 +89,7 @@
8589
'h5py': ('https://docs.h5py.org/en/stable/', None),
8690
'pydaqmx': ('https://pythonhosted.org/PyDAQmx/', None),
8791
'qt': (
88-
'',
92+
'https://riverbankcomputing.com/static/Docs/PyQt5/',
8993
'pyqt5-modified-objects.inv',
9094
) # from https://github.com/MSLNZ/msl-qt/blob/master/docs/create_pyqt_objects.py
9195
# under MIT License

docs/source/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
You can adapt this file completely to your liking, but it should at least
44
contain the root `toctree` directive.
55
6-
labscript-devices
7-
=================
6+
labscript-devices |version|
7+
===========================
88

99
This portion of the **labscript-suite** contains the plugin architecture for controlling experimental hardware.
1010
In particular, this code provides the interface between **labscript** high-level instructions and hardware-specific instructions, the communication interface to send those instructions to the hardware, and the **BLACS** instrument control interface.

docs/source/user_devices.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ Please direct any questions regarding these repositories to their respective own
3232
* `NAQS Lab <https://github.com/naqslab/naqslab_devices>`__
3333
* `Vladan Vuletic Group Rb Lab, MIT <https://github.com/zakv/RbLab_user_devices>`__
3434

35-
If you would like to add your repository to this list, :doc:`please contact us or make a pull request<labscript-suite:contributing>`.
35+
If you would like to add your repository to this list, :doc:`please contact us or make a pull request<labscript-suite:project/contributing>`.

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Tracker = "https://github.com/labscript-suite/labscript-devices/issues/"
5959
[project.optional-dependencies]
6060
docs = [
6161
"PyQt5",
62-
"Sphinx==7.2.6",
63-
"sphinx-rtd-theme==2.0.0",
64-
"myst_parser==2.0.0",
62+
"Sphinx==8.2.3",
63+
"sphinx-rtd-theme==3.0.2",
64+
"myst_parser==4.0.1",
6565
]

readthedocs.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ build:
99
os: ubuntu-22.04
1010
tools:
1111
python: "3.11"
12+
jobs:
13+
# ensure full git repo is pulled so setuptools_scm gets versions correctly on install
14+
# https://docs.readthedocs.com/platform/stable/build-customization.html#unshallow-git-clone
15+
post_checkout:
16+
- git fetch --unshallow || true
17+
- git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*' || true
18+
- git fetch --all --tags || true
1219

1320
# Build documentation in the docs/ directory with Sphinx
1421
sphinx:

0 commit comments

Comments
 (0)