diff --git a/README.rst b/README.rst index 6aa2842df..bdd799947 100644 --- a/README.rst +++ b/README.rst @@ -87,6 +87,10 @@ in development * Replace the deprecated dependency appdirs with platformdirs. * Fix WinError caused by the failure of the symlink creation process. Pydoctor should now run on windows without the need to be administrator. +* Adjust the sphinx extension to support Sphinx 8.1. The entries dynamically added to the intersphinx config + from the ``pydoctor_url_path`` config option now includes a project name which defaults to 'main' (instead of putting None), + use mapping instead of a list define your own project name. + pydoctor 24.3.3 ^^^^^^^^^^^^^^^ diff --git a/pydoctor/epydoc/markup/restructuredtext.py b/pydoctor/epydoc/markup/restructuredtext.py index 36e2cf796..8c11806d7 100644 --- a/pydoctor/epydoc/markup/restructuredtext.py +++ b/pydoctor/epydoc/markup/restructuredtext.py @@ -41,7 +41,10 @@ from __future__ import annotations __docformat__ = 'epytext en' -from typing import Any, Iterable, List, Optional, Sequence, Set, cast +from typing import TYPE_CHECKING, Any, Iterable, List, Optional, Sequence, Set, cast +if TYPE_CHECKING: + from typing import TypeAlias + import re from docutils import nodes @@ -190,7 +193,12 @@ def report(self, error: nodes.system_message) -> None: self._errors.append(ParseError(msg, linenum, is_fatal)) -class _DocumentPseudoWriter(Writer): +if TYPE_CHECKING: + _StrWriter: TypeAlias = Writer[str] +else: + _StrWriter = Writer + +class _DocumentPseudoWriter(_StrWriter): """ A pseudo-writer for the docutils framework, that can be used to access the document itself. The output of C{_DocumentPseudoWriter} diff --git a/pydoctor/sphinx_ext/build_apidocs.py b/pydoctor/sphinx_ext/build_apidocs.py index 1247e0071..7463bbc85 100644 --- a/pydoctor/sphinx_ext/build_apidocs.py +++ b/pydoctor/sphinx_ext/build_apidocs.py @@ -113,7 +113,7 @@ def on_builder_inited(app: Sphinx) -> None: intersphinx_mapping = config.intersphinx_mapping url = url_path.format(**{'rtd_version': rtd_version}) inv = (str(temp_path / 'objects.inv'),) - intersphinx_mapping[f'{key}-api-docs'] = (None, (url, inv)) + intersphinx_mapping[f'{key}-api-docs'] = (key, (url, inv)) # Build the API docs in temporary path. shutil.rmtree(temp_path, ignore_errors=True)