Skip to content

Commit 57d931e

Browse files
authored
Update for Sphinx v9 Compatibility (#25)
* update kwarg passing to generate_autosummary_content for sphinx v9+ * change checkout fetch-depth so setuptools_scm will ("should") work * add test case on py 3.14 * add test case for sphinx<9 * set fetch-depth 0 for sphinx_limits tests (for setuptools_scm to work) * update Automodsumm.get_items
1 parent e1944d7 commit 57d931e

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

.github/workflows/documentation.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
python: ['3.8', '3.10', '3.11', '3.12', '3.13']
23+
python: ['3.8', '3.10', '3.11', '3.12', '3.13', '3.14']
2424
os: [ubuntu-latest]
2525

2626
steps:
2727
- name: Checkout code
2828
uses: actions/checkout@v3
2929
with:
30-
fetch-depth: 1
30+
fetch-depth: 0
3131
- name: Set up Python
3232
uses: actions/setup-python@v5
3333
with:
@@ -63,11 +63,15 @@ jobs:
6363
os: ubuntu-latest
6464
sphinx: sphinx<8.2
6565

66+
- python: '3.13'
67+
os: ubuntu-latest
68+
sphinx: sphinx<9.0
69+
6670
steps:
6771
- name: Checkout code
6872
uses: actions/checkout@v3
6973
with:
70-
fetch-depth: 1
74+
fetch-depth: 0
7175
- name: Set up Python
7276
uses: actions/setup-python@v5
7377
with:

plasmapy_sphinx/automodsumm/core.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,11 @@ def option_processor(self):
623623
return processor
624624

625625
def get_items(self, names):
626-
self.bridge.genopt["imported-members"] = True
626+
if Version(sphinx_version) < Version("9.0"):
627+
self.bridge.genopt["imported-members"] = True
628+
else:
629+
# sphinx dropped the use of DocumenterBridge in v9.0
630+
self.options["imported-members"] = True
627631
return Autosummary.get_items(self, names)
628632

629633
@property

plasmapy_sphinx/automodsumm/generate.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,13 @@ def generate_docs(
321321
}
322322
if Version(sphinx_version) < Version("8.2"):
323323
_kwargs["app"] = app
324-
else:
324+
elif Version(sphinx_version) < Version("9.0"):
325325
_kwargs["config"] = app.config
326326
_kwargs["events"] = app.events
327327
_kwargs["registry"] = app.registry
328+
else:
329+
_kwargs["config"] = app.config
330+
_kwargs["events"] = app.events
328331

329332
content = generate_autosummary_content(**_kwargs)
330333

0 commit comments

Comments
 (0)