Skip to content

Intersphinx mapping for stdlib version #485

Description

@stefan6419846

In my code, I have type hints which refer to importlib.metadata. The corresponding docs at https://docs.python.org/3/library/importlib.metadata.html point to the docs of importlib_metadata for the API reference and do not explicitly list the API details. importlib_metadata provides them.

Now I am trying to generate docs using Sphinx and utilize the intersphinx mapping functionality to link to importlib.metadata members. With this, I am in the situation that I would have to use importlib_metadata only to ensure that the docs and especially the intersphinx mappings work correctly and I have no undefined references.

At the moment, there basically are two mapping files:

  • The stdlib one does not provide references for importlib.metadata as the API reference is not part of the stdlib docs.
  • The importlib_metadata one provides references for importlib_metadata imports, but not for the importlib.metadata ones.

My current workaround is to basically generate a custom version of the importlib_metadata intersphinx mapping which replaces all importlib_metadata names with importlib.metadata, but this does not feel like a good solution.

What is the correct approach to get the intersphinx mapping working for both the stdlib and standalone versions without having to solely rely on the standalone version? (Please note that I am not sure which issue tracker is more suitable for this, but as the standalone version provides the API reference, I just went with this repository for now.)

Activity

  1. stefan6419846 commented on Jan 7, 2025

    @stefan6419846
    Author

    This seems to have been fixed in the meantime. Thus I am closing it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions