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

docs: switch to sphinx-autodoc-typehints #1854

Commits on Apr 19, 2022

  1. docs: switch to sphinx-autodoc-typehints

    Currently rdflib is relying on sphinx-autodoc's built in handling for type
    hints, this however has some deficiencies as it does not handle stuff
    inside `if TYPE_CHECKING:` and thus only work in cases where there are no
    potential for circular dependencies.
    
    This patch changes sphinx to use sphinx-autodoc-typehints instead, the
    documentation generated by this plugin looks slightly different but as a
    positive it correctly works with things defined inside `if TYPE_CHECKING:`
    guards.
    
    Also:
    - moved the `_NamespaceSetString` type alias to `rdflib._type_checking`
      This is so that `sphinx-autodoc-typehints` recognizes it up, as it
      does not handle type aliases that are defined inside
      `if TYPE_CHECKING:` guards in imported files.
    - remove sphinx requirements from requirements.dev.txt and
      replaced it with -r docs/sphinx-requirements.txt to reduce redundancy.
    aucampia committed Apr 19, 2022
    Configuration menu
    Copy the full SHA
    af93d38 View commit details
    Browse the repository at this point in the history