Skip to content
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
22 changes: 22 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,28 @@ jobs:
name: ${{ matrix.os }}_${{ matrix.python-version }}_${{matrix.sphinx-version}}_htmlcov
path: htmlcov

check_test_docs:

name: "Build all 'test docs' in strict mode to make sure they run without warning"

runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .

- name: Build all tests docs
run: make -C tests all

build-n-publish:
if: startsWith(github.ref, 'refs/tags') && github.repository == 'sphinx-contrib/matlabdomain'
name: Build and publish Python 🐍 distributions 📦 to PyPI
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXOPTS = --verbose --color --fail-on-warning
SPHINXBUILD = sphinx-build
SPHINXPROJ = sphinxcontrib-matlabdomain
SOURCEDIR = .
Expand Down
15 changes: 15 additions & 0 deletions tests/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
all:
# Run all doc builds in the tests folder:
# acts a bit as en end-to-end test
make -C test_docs html
make -C roots/test_autodoc/ html
make -C roots/test_classfolder/ html
make -C roots/test_duplicate_link/ html
make -C roots/test_module_class_names/ html
make -C roots/test_no_matlab_src_dir/ html
make -C roots/test_numad/ html
make -C roots/test_package_links/ html
make -C roots/test_package_prefix/ html
make -C roots/test_pymat/ html
make -C roots/test_pymat_common_root/ html
make -C roots/test_skipping_module_members/ html
1 change: 1 addition & 0 deletions tests/roots/test_autodoc/BaseClass.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
% BaseClass Methods:
% BaseClass - the constructor, whose description extends
% to the next line
%
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixes a doc build warning

% DoBase - another BaseClass method
%
% See Also
Expand Down
2 changes: 1 addition & 1 deletion tests/roots/test_autodoc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXOPTS = --verbose --color --fail-on-warning
SPHINXBUILD = sphinx-build
SPHINXPROJ = test_autodoc
SOURCEDIR = .
Expand Down
2 changes: 2 additions & 0 deletions tests/roots/test_autodoc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
extensions = ["sphinx.ext.autodoc", "sphinxcontrib.matlab"]
primary_domain = "mat"
nitpicky = True
# ignore warning about inheriting from unknown 'handle' class
nitpick_ignore = [("mat:class", "handle")]
3 changes: 0 additions & 3 deletions tests/roots/test_autodoc/target/readme.txt

This file was deleted.

2 changes: 1 addition & 1 deletion tests/roots/test_classfolder/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXOPTS = --verbose --color --fail-on-warning
SPHINXBUILD = sphinx-build
SPHINXPROJ = test_classfolder
SOURCEDIR = .
Expand Down
2 changes: 1 addition & 1 deletion tests/roots/test_duplicate_link/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXOPTS = --verbose --color --fail-on-warning
SPHINXBUILD = sphinx-build
SPHINXPROJ = sphinxcontrib-matlabdomain
SOURCEDIR = .
Expand Down
2 changes: 1 addition & 1 deletion tests/roots/test_duplicate_link/_src/+replab/Domain.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
classdef Domain
% Describes a set of elements with a common structure
%
% Those elements can be compared (`.eqv`), and random elements can be produced (`.sample`).
Copy link
Copy Markdown
Collaborator Author

@Remi-Gau Remi-Gau Jan 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be removed to avoid a warning about a missing ref

% Those elements can be compared (`.eqv`).

methods % ABSTRACT

Expand Down
2 changes: 2 additions & 0 deletions tests/roots/test_duplicate_link/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@
matlab_keep_package_prefix = True
matlab_src_dir = f"{os.path.dirname(os.path.abspath(f'{__file__}/'))}/_src"
nitpicky = True
# ignore warning about inheriting from unknown 'replab.CompactGroup' class
nitpick_ignore = [("mat:class", "replab.CompactGroup")]
primary_domain = "mat"
2 changes: 1 addition & 1 deletion tests/roots/test_no_matlab_src_dir/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXOPTS = --verbose --color --fail-on-warning
SPHINXBUILD = sphinx-build
SPHINXPROJ = test_autodoc
SOURCEDIR = .
Expand Down
2 changes: 1 addition & 1 deletion tests/roots/test_numad/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXOPTS = --verbose --color --fail-on-warning
SPHINXBUILD = sphinx-build
SPHINXPROJ = test_autodoc
SOURCEDIR = .
Expand Down
2 changes: 1 addition & 1 deletion tests/roots/test_package_links/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXOPTS = --verbose --color --fail-on-warning
SPHINXBUILD = sphinx-build
SPHINXPROJ = test_autodoc
SOURCEDIR = .
Expand Down
2 changes: 2 additions & 0 deletions tests/roots/test_package_links/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
matlab_keep_package_prefix = True
primary_domain = "mat"
nitpicky = True
# ignore warning about inheriting from unknown 'handle' class
nitpick_ignore = [("mat:class", "handle")]
2 changes: 1 addition & 1 deletion tests/roots/test_package_prefix/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXOPTS = --verbose --color --fail-on-warning
SPHINXBUILD = sphinx-build
SPHINXPROJ = test_autodoc
SOURCEDIR = .
Expand Down
2 changes: 1 addition & 1 deletion tests/roots/test_pymat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXOPTS = --verbose --color --fail-on-warning
SPHINXBUILD = sphinx-build
SPHINXPROJ = test_autodoc
SOURCEDIR = .
Expand Down
8 changes: 5 additions & 3 deletions tests/test_autodoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,11 @@ def test_root_auto_link_basic(app, confdict):
see_also_line_1 = content[0][2][1][1][1] # a bit fragile, I know
see_also_line_2 = content[0][4][1][1][0] # a bit fragile, I know
assert len(content) == 1
assert (
method_section.rawsource
== "BaseClass Methods:\n* :meth:`BaseClass() <BaseClass.BaseClass>` - the constructor, whose description extends\n to the next line\n* :meth:`DoBase() <BaseClass.DoBase>` - another BaseClass method\n"
assert method_section.rawsource == (
"BaseClass Methods:\n"
"* :meth:`BaseClass() <BaseClass.BaseClass>` - the constructor, whose description extends\n"
" to the next line\n\n"
"DoBase - another BaseClass method\n"
Copy link
Copy Markdown
Collaborator Author

@Remi-Gau Remi-Gau Jan 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needed to change this test after modifying BaseClass (see https://github.com/sphinx-contrib/matlabdomain/pull/340/files#r2680058113)

but I am a bit surprised that just adding an extra line changes:

"* :meth:`DoBase() <BaseClass.DoBase>` - another BaseClass method\n"

to

"DoBase - another BaseClass method\n"

)
assert (
see_also_line_1.rawsource
Expand Down
8 changes: 3 additions & 5 deletions tests/test_autodoc_short_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,9 @@ def test_root_auto_link_basic(app, confdict):
method_section = content[0][2][1][1][0] # a bit fragile, I know
assert method_section.rawsource == (
"BaseClass Methods:\n"
"* :meth:`BaseClass() <BaseClass.BaseClass>` "
"- the constructor, whose description extends\n"
" to the next line\n"
"* :meth:`DoBase() <BaseClass.DoBase>` "
"- another BaseClass method\n"
"* :meth:`BaseClass() <BaseClass.BaseClass>` - the constructor, whose description extends\n"
" to the next line\n\n"
"DoBase - another BaseClass method\n"
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

)

see_also_line_1 = content[0][2][1][1][1] # a bit fragile, I know
Expand Down
Loading