Skip to content

NewType and TypeVar don't resolve correctly #8415

@anselor

Description

@anselor

Describe the bug
Autodoc generates warnings and doesn't resolve NewType or TypeVar correctly.

To Reproduce
Steps to reproduce the behavior:

$ git clone https://github.com/anselor/sphinx-issues-examples/
$ cd sphinx-issues-examples/typevar-namespace
$ python -m sphinx -b html docs/ doc-out/ -nvWT

Expected behavior
Documentation generated with TypeVar and NewType names that link to the documented declaration

Your project
https://github.com/anselor/sphinx-issues-examples/tree/main/typevar-namespace

Screenshots
If applicable, add screenshots to help explain your problem.

Environment info

  • OS: Ubuntu 18.04, 20.04
  • Python version: 3.6.9, 3.8.2
  • Sphinx version: 3.2.1
  • Sphinx extensions: sphinx.ext.autodoc
  • Extra tools:

Additional context
Add any other context about the problem here.

  • [e.g. URL or Ticket]

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions