Skip to content

Commit 6d4b9eb

Browse files
authored
update call to sphinx.util.typing.stringify in conf.py (#255)
* update call to sphinx.util.typing.stringify in conf.py * remove duplicate entries in nitpick_ignore list
1 parent c7e5ec9 commit 6d4b9eb

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

docs/conf.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,6 @@
411411
# Example C++ types
412412
("cpp:identifier", "Sphinx"),
413413
("cpp:identifier", "RF24_SPI_SPEED"),
414-
("cpp:identifier", "RF24_SPI_SPEED"),
415414
# C++ namespaces referenced in the documentation
416415
#
417416
# It is a bug in the C++ domain that a reference to `ns::symbol` will
@@ -427,13 +426,6 @@
427426
("cpp:identifier", "my_ns2::my_nested_ns"),
428427
("cpp:identifier", "my_ns3"),
429428
("cpp:identifier", "cpp_apigen_demo"),
430-
("cpp:identifier", "::nlohmann"),
431-
("cpp:identifier", "std"),
432-
("cpp:identifier", "synopses_ex"),
433-
("cpp:identifier", "my_ns1"),
434-
("cpp:identifier", "my_ns2"),
435-
("cpp:identifier", "my_ns2::my_nested_ns"),
436-
("cpp:identifier", "my_ns3"),
437429
# Example JavaScript types
438430
("js:func", "string"),
439431
("js:func", "SomeError"),
@@ -472,6 +464,12 @@ def _validate_parallel_build(app):
472464
assert app.is_parallel_allowed("write")
473465

474466

467+
if sphinx.version_info >= (6, 1):
468+
stringify = sphinx.util.typing.stringify_annotation
469+
else:
470+
stringify = sphinx.util.typing.stringify
471+
472+
475473
def _parse_object_description_signature(
476474
env: sphinx.environment.BuildEnvironment, signature: str, node: docutils.nodes.Node
477475
) -> str:
@@ -485,7 +483,7 @@ def _parse_object_description_signature(
485483
else:
486484
node += sphinx.addnodes.desc_sig_punctuation(" : ", " : ")
487485
annotations = sphinx.domains.python._parse_annotation(
488-
sphinx.util.typing.stringify(registry_option.type_constraint), env
486+
stringify(registry_option.type_constraint), env
489487
)
490488
node += sphinx.addnodes.desc_type("", "", *annotations)
491489
node += sphinx.addnodes.desc_sig_punctuation(" = ", " = ")
@@ -517,7 +515,7 @@ def _parse_confval_signature(
517515
type_constraint = typing.Union[tuple(types)]
518516
node += sphinx.addnodes.desc_sig_punctuation(" : ", " : ")
519517
annotations = sphinx.domains.python._parse_annotation(
520-
sphinx.util.typing.stringify(type_constraint), env
518+
stringify(type_constraint), env
521519
)
522520
node += sphinx.addnodes.desc_type("", "", *annotations)
523521
if not callable(default):

0 commit comments

Comments
 (0)