Skip to content

Rtd fixes #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
AUTOSUMMARYDIR = source/api/_autosummary

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

.PHONY: help Makefile
clean:
@echo "Removing autosummary directory"
@rm -rf $(AUTOSUMMARYDIR)
@$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help clean Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
Expand Down
8 changes: 8 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ if "%SPHINXBUILD%" == "" (
)
set SOURCEDIR=source
set BUILDDIR=build
set AUTOSUMMARYDIR=source\api\_autosummary

if "%1" == "" goto help
if "%1" == "clean" goto clean

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
Expand All @@ -30,6 +32,12 @@ goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:clean
echo Removing autosummary directory
rmdir /s/q %AUTOSUMMARYDIR%
%SPHINXBUILD% -M clean %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
1 change: 0 additions & 1 deletion docs/source/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ API Reference

.. autosummary::
:toctree: _autosummary
:template: autosummary-module.rst
:recursive:

labscript_utils
Expand Down
5 changes: 3 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import os
from pathlib import Path
from jinja2 import FileSystemLoader, Environment
import importlib.metadata

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

Expand All @@ -22,7 +23,7 @@
author = "labscript suite contributors"

# The full version, including alpha/beta/rc tags
from labscript_utils import __version__ as version # noqa: E402
version = importlib.metadata.version('labscript-utils')

release = version

Expand Down Expand Up @@ -103,7 +104,7 @@
'h5py': ('https://docs.h5py.org/en/stable/', None),
'pydaqmx': ('https://pythonhosted.org/PyDAQmx/', None),
'qt': (
'',
'https://riverbankcomputing.com/static/Docs/PyQt5/',
'pyqt5-modified-objects.inv',
) # from https://github.com/MSLNZ/msl-qt/blob/master/docs/create_pyqt_objects.py
# under MIT License
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ Tracker = "https://github.com/labscript-suite/labscript-utils/issues/"
[project.optional-dependencies]
docs = [
"PyQt5",
"Sphinx==7.2.6",
"sphinx-rtd-theme==2.0.0",
"myst_parser==2.0.0",
"Sphinx==8.2.3",
"sphinx-rtd-theme==3.0.1",
"myst_parser==4.0.1",
]

[project.scripts]
Expand Down
7 changes: 7 additions & 0 deletions readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ build:
os: ubuntu-22.04
tools:
python: "3.11"
jobs:
# ensure full git repo is pulled so setuptools_scm gets versions correctly on install
# https://docs.readthedocs.com/platform/stable/build-customization.html#unshallow-git-clone
post_checkout:
- git fetch --unshallow || true
- git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*' || true
- git fetch --all --tags || true

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down