Skip to content

Commit ff894ba

Browse files
committed
docs: guard frozendict doc entries behind py315 Sphinx tag
ReadTheDocs builds with Python 3.13 where `treespec_frozendict` does not exist. Use `.. only:: py315` directive to conditionally include the autosummary and autofunction entries, with the tag set in conf.py based on `sys.version_info >= (3, 15)`.
1 parent cd4a2e2 commit ff894ba

3 files changed

Lines changed: 17 additions & 3 deletions

File tree

docs/source/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ def get_version() -> str:
7979
if not os.getenv('READTHEDOCS', None):
8080
extensions.append('sphinxcontrib.spelling')
8181

82+
if sys.version_info >= (3, 15):
83+
tags.add('py315p') # noqa: F821 # `tags` is a Sphinx built-in
84+
8285
# Add any paths that contain templates here, relative to this directory.
8386
templates_path = ['_templates']
8487

docs/source/ops.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ Tree Reduce Functions
150150
treespec_defaultdict
151151
treespec_deque
152152
treespec_structseq
153-
treespec_frozendict
154153
treespec_from_collection
155154

156155
.. autofunction:: treespec_paths
@@ -176,5 +175,9 @@ Tree Reduce Functions
176175
.. autofunction:: treespec_defaultdict
177176
.. autofunction:: treespec_deque
178177
.. autofunction:: treespec_structseq
179-
.. autofunction:: treespec_frozendict
178+
179+
.. only:: py315p
180+
181+
.. autofunction:: treespec_frozendict
182+
180183
.. autofunction:: treespec_from_collection

docs/source/treespec.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,13 @@ Check section :ref:`PyTreeSpec Functions` for more detailed documentation.
2222
defaultdict
2323
deque
2424
structseq
25-
frozendict
25+
26+
.. only:: py315p
27+
28+
.. autosummary::
29+
30+
frozendict
31+
32+
.. autosummary::
33+
2634
from_collection

0 commit comments

Comments
 (0)