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

autodoc_type_aliases not working when autodoc_class_signature is "separated". #10524

Open
aaronhnsy opened this issue Jun 4, 2022 · 2 comments

Comments

@aaronhnsy
Copy link

Describe the bug

When autodoc_class_signature is set to separated, a type alias config as follows

autodoc_type_aliases: dict[str, str] = {
    "BotT": "~discord.ext.commands.Bot | ~discord.ext.commands.AutoShardedBot",
    "ContextT": "~discord.ext.commands.Context",
    "PlayerT": "~slate.Player",
}

produces the following outputs:

Sunday 05 June 2022 at 00-48 chrome Lanky
Sunday 05 June 2022 at 00-49 chrome Twin

However, when set to mixed, these same outputs look like:

Sunday 05 June 2022 at 00-51 chrome Unimportant
Sunday 05 June 2022 at 00-51 chrome Courteous

How to Reproduce

$ git clone https://github.com/Axelware/slate
$ cd slate
$ poetry install -E dev -E docs
$ # change `autodoc_class_signature` in `conf.py` to `separated`.
$ cd docs
$ make html
$ # open _build/html/index.html

Expected behavior

This option shouldn't affect how the type aliases are mapped.

Your project

https://github.com/Axelware/slate

Screenshots

No response

OS

WIndows

Python version

3.10

Sphinx version

5.0.1

Sphinx extensions

sphinx.ext.autodoc, sphinx.ext.napoleon, sphinx.ext.intersphinx, sphinx.ext.extlinks, sphinxcontrib_trio, sphinx_copybutton, sphinx_inline_tabs

Extra tools

No response

Additional context

No response

@AA-Turner
Copy link
Member

@Axelancerr can you add a minimal reproducer a la #10497 (comment)? It makes it much easier to debug.

A

@AA-Turner AA-Turner added this to the 5.x milestone Jun 5, 2022
@aaronhnsy
Copy link
Author

aaronhnsy commented Jun 5, 2022

Hi, here's a paste for a minimal producer similar to the one you linked me: https://mystb.in/HunterHandbookBoards.python

(sorry, its a bit long)

@AA-Turner AA-Turner modified the milestones: 5.x, 6.x Oct 4, 2022
@AA-Turner AA-Turner modified the milestones: 6.x, 7.x Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants