Skip to content

Commit 74b80c9

Browse files
fix: Correct Read The Docs build failures (#115)
* Restrict versions of packages to work with python3.10 * Remove duplicates when using automock * Add xmlschema to requirements * Update doc-test.yml workflow to match Read The Docs build
1 parent 4183851 commit 74b80c9

File tree

3 files changed

+43
-15
lines changed

3 files changed

+43
-15
lines changed

.github/workflows/doc-test.yml

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,46 @@
11
name: "Pull Request Docs Check"
2-
on:
3-
- pull_request
2+
3+
on:
4+
pull_request
45

56
# Cancels in-progress workflows for a PR when updated
67
concurrency:
78
group: ${{ github.workflow }}-${{ github.ref }}
89
cancel-in-progress: true
910

1011
jobs:
11-
docs:
12-
runs-on: ubuntu-latest
12+
docs-build:
13+
# Use the same OS as Read the Docs
14+
runs-on: ubuntu-22.04
15+
1316
steps:
14-
- uses: actions/checkout@v1
15-
- uses: ammaraskar/sphinx-action@dev
16-
with:
17-
docs-folder: "docs/"
18-
build-command: "sphinx-build -b html . _build -W"
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
# Use the same Python version as Read the Docs
24+
python-version: "3.10"
25+
26+
- name: Set up Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
# Use the same Node.js version as Read the Docs
30+
node-version: "16"
31+
32+
- name: Install system dependencies
33+
run: |
34+
sudo apt-get update
35+
sudo apt-get install -y --no-install-recommends plantuml texlive npm
36+
37+
- name: Install Node.js packages
38+
run: |
39+
npm install -g [email protected]
40+
npm install -g @mermaid-js/[email protected]
41+
42+
- name: Install Python dependencies
43+
run: pip install -r docs/requirements.txt
44+
45+
- name: Build documentation with Sphinx
46+
run: sphinx-build -b html docs/ docs/_build -W

docs/conf.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@
5050
]
5151

5252
autoclass_content = 'both'
53-
autodoc_mock_imports = [ "ats", "colorcet", "h5py", "lxml", "matplotlib", "meshio", "mpi4py", "numba", "pandas",
54-
"paraview", "pygeosx", "pyevtk", "pylvarray", "scipy", "segyio", "vtk", "xmlschema",
55-
"xmltodict", "xsdata" ]
53+
autodoc_mock_imports = [ "ats", "colorcet", "meshio", "mpi4py", "numba", "paraview", "pygeosx",
54+
"pyevtk", "pylvarray", "scipy", "segyio", "xmltodict", "xsdata" ]
5655
autodoc_typehints = 'none'
5756
autodoc_typehints_format = 'short'
5857
suppress_warnings = [ "autodoc.mocked_object" ]

docs/requirements.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
sphinx >= 8.2
1+
sphinx < 8.2
22
sphinx_rtd_theme >= 3.0
33
sphinx-argparse >= 0.5
4-
sphinx-autodoc-typehints >= 3.1
4+
sphinx-autodoc-typehints < 3.1
55
sphinx-design >= 0.6
66
# Running CLI programs and capture outputs
77
sphinxcontrib-programoutput >= 0.17
@@ -12,8 +12,9 @@ tqdm >= 4.67
1212
numpy >= 2.2
1313
pandas >= 2.2
1414
typing_extensions > 4.12
15-
matplotlib>=3.9.4
15+
matplotlib ~= 3.9.0
1616
h5py >= 3.12
1717
lxml >= 4.5.0
1818
parameterized >= 0.9
1919
pyvista >= 0.44
20+
xmlschema

0 commit comments

Comments
 (0)