Skip to content
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

Fix format_signatures to work with Sphinx < 7.3 #373

Merged
merged 1 commit into from
Jul 25, 2024
Merged
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
14 changes: 8 additions & 6 deletions sphinx_immaterial/apidoc/format_signatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,18 +577,20 @@
ignored, node, "(", ")"
)
),
sphinx.addnodes.desc_type_parameter_list: (
lambda ignored, node: _sig_transform_desc_parameter_list(
ignored, node, "[", "]"
)
),
sphinx.addnodes.desc_parameter: _sig_transform_parameter,
sphinx.addnodes.desc_type_parameter: _sig_transform_parameter,
sphinx.addnodes.desc_returns: _sig_transform_desc_returns,
sphinx.addnodes.pending_xref: _sig_transform_generic,
sphinx.ext.viewcode.viewcode_anchor: _sig_transform_viewcode_anchor,
}

if sphinx.version_info >= (7, 3):
_SIG_TRANSFORM_FUNCS[

Check warning on line 587 in sphinx_immaterial/apidoc/format_signatures.py

View check run for this annotation

Codecov / codecov/patch

sphinx_immaterial/apidoc/format_signatures.py#L586-L587

Added lines #L586 - L587 were not covered by tests
sphinx.addnodes.desc_type_parameter_list
] = lambda ignored, node: _sig_transform_desc_parameter_list(
ignored, node, "[", "]"
)
_SIG_TRANSFORM_FUNCS[sphinx.addnodes.desc_type_parameter] = _sig_transform_parameter

Check warning on line 592 in sphinx_immaterial/apidoc/format_signatures.py

View check run for this annotation

Codecov / codecov/patch

sphinx_immaterial/apidoc/format_signatures.py#L592

Added line #L592 was not covered by tests


def _sig_transform_node(
ignored: set[int], node: docutils.nodes.Node
Expand Down
Loading