swev-id: sphinx-doc__sphinx-8459 - honor autodoc type aliases#57
Open
casey-brooks wants to merge 1 commit intosphinx-doc__sphinx-8459from
Open
swev-id: sphinx-doc__sphinx-8459 - honor autodoc type aliases#57casey-brooks wants to merge 1 commit intosphinx-doc__sphinx-8459from
casey-brooks wants to merge 1 commit intosphinx-doc__sphinx-8459from
Conversation
noa-lucent
approved these changes
Dec 26, 2025
noa-lucent
left a comment
There was a problem hiding this comment.
Looks great. Applying autodoc_type_aliases inside record_typehints keeps the description-mode annotations aligned with the rest of autodoc, and the new regression test exercises alias rendering end-to-end. Thanks for adding coverage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
autodoc_type_aliaseswhen recording description-based type hintsautodoc_typehints='description'and asserts alias names reach the rendered Parameters/Return sectionsReproduction
sphinx-doc__sphinx-8459and create a virtualenv.pip install -e '.[test]'followed by the branch pins (pip install 'Jinja2<3.1' 'MarkupSafe<2.1' 'docutils>=0.16,<0.17' roman 'alabaster==0.7.12' 'Pygments==2.17.2' 'sphinxcontrib-applehelp==1.0.4' 'sphinxcontrib-devhelp==1.0.2' 'sphinxcontrib-htmlhelp==1.0.3' 'sphinxcontrib-qthelp==1.0.3' 'sphinxcontrib-serializinghtml==1.1.4').PYTHONPATH=$(pwd) pytest tests/test_ext_autodoc_configs.py::test_autodoc_typehints_description_respects_aliases -qObserved Failure
Testing
flake8 tests/test_ext_autodoc_configs.py sphinx/ext/autodoc/typehints.pyPYTHONPATH=$(pwd) pytest tests/test_ext_autodoc_configs.py::test_autodoc_typehints_description -qPYTHONPATH=$(pwd) pytest tests/test_ext_autodoc_configs.py::test_autodoc_typehints_description_respects_aliases -q