You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
importlib.metadata docs not showing up in the module index #81922
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/warsaw'closed_at=<Date2021-04-15.00:59:56.068>created_at=<Date2019-08-01.18:47:05.826>labels= ['3.8', '3.9', '3.10', 'docs']
title='importlib.metadata docs not showing up in the module index'updated_at=<Date2021-06-27.22:05:30.764>user='https://github.com/brettcannon'
Provisional status should not cause a module or other API element to be omitted from the indexes. So long as it's marked provisional where it's described, it should be locatable.
There's an importlib.metadata.rst file which describes how to use the API, but that doesn't appear to be linked from either the main library ToC or the importlib documentation itself. I'll see if I can put together a PR to fix this.
Including a module directive with synopsis as below in importlib.metadata.rst seems to fix this. It would also be good to include a link to source code from the importlib.metadata docs page since it's written in Python.
.. module:: importlib.metadata
:synopsis: The implementation of the importlib metadata.
@jaraco - Why is the code in [Lib/importlib/metadata/__init__.py](https://github.com/python/cpython/blob/main/Lib/importlib/metadata/__init__.py) instead of [Lib/importlib/metadata.py](https://github.com/python/cpython/blob/main/Lib/importlib/metadata.py)? Is that to make it easier to port between CPython stdlib and the standalone version?
The docs at https://docs.python.org/3/library/importlib.metadata.html also don't list the API at all, it is just a tutorial, not a reference. I see the code has docstrings, but they are missing from the docs. E.g. PackageNotFoundError is not documented at all.
New changeset 23acadc by Jason R. Coombs in branch 'master': bpo-37741: make importlib.metadata docs discoverable through a module directive. (GH-25415) 23acadc
New changeset a746fce by Miss Islington (bot) in branch '3.8': bpo-37741: make importlib.metadata docs discoverable through a module directive. (GH-25415) a746fce
New changeset ab1c3d9 by Miss Islington (bot) in branch '3.9': bpo-37741: make importlib.metadata docs discoverable through a module directive. (GH-25415) (GH-25417) ab1c3d9
New changeset 17b9167 by Jason R. Coombs in branch '3.9':
[3.9] bpo-37741: make importlib.metadata docs discoverable through a module directive. (GH-25415) (GH-26500) 17b9167
Activity
brettcannon commentedon Aug 1, 2019
If you look at https://docs.python.org/3.9/py-modindex.html#cap-i you will see that importlib.metadata isn't listed (same goes for the 3.8 docs).
Or are you leaving it out due to it being provisional?
freddrake commentedon Aug 1, 2019
Provisional status should not cause a module or other API element to be omitted from the indexes. So long as it's marked provisional where it's described, it should be locatable.
warsaw commentedon Aug 5, 2019
There's an importlib.metadata.rst file which describes how to use the API, but that doesn't appear to be linked from either the main library ToC or the importlib documentation itself. I'll see if I can put together a PR to fix this.
tirkarthi commentedon Aug 5, 2019
Including a module directive with synopsis as below in importlib.metadata.rst seems to fix this. It would also be good to include a link to source code from the importlib.metadata docs page since it's written in Python.
.. module:: importlib.metadata
:synopsis: The implementation of the importlib metadata.
**Source code:** :source:`Lib/importlib/metadata/init.py`
warsaw commentedon Aug 5, 2019
@jaraco - Why is the code in
[Lib/importlib/metadata/__init__.py](https://github.com/python/cpython/blob/main/Lib/importlib/metadata/__init__.py)instead of[Lib/importlib/metadata.py](https://github.com/python/cpython/blob/main/Lib/importlib/metadata.py)? Is that to make it easier to port between CPython stdlib and the standalone version?jaraco commentedon Aug 5, 2019
Mainly because originally, the code was in multiple modules. I'm happy for it to move into a single file module.
brettcannon commentedon Aug 6, 2019
If there's no porting benefit then let's move it to a single module instead of a package.
warsaw commentedon Aug 6, 2019
I’ll do a PR for that too.
hroncok commentedon Mar 15, 2021
The docs at https://docs.python.org/3/library/importlib.metadata.html also don't list the API at all, it is just a tutorial, not a reference. I see the code has docstrings, but they are missing from the docs. E.g. PackageNotFoundError is not documented at all.
brettcannon commentedon Apr 14, 2021
Are you still planning to fix this, Barry?
warsaw commentedon Apr 14, 2021
I'd still like to. I'm also happy to review any PRs if someone beats me to it.
miss-islington commentedon Apr 15, 2021
New changeset 23acadc by Jason R. Coombs in branch 'master':
bpo-37741: make importlib.metadata docs discoverable through a module directive. (GH-25415)
23acadc
warsaw commentedon Apr 15, 2021
@jaraco beat me to it. PRs approved!
miss-islington commentedon Apr 15, 2021
New changeset a746fce by Miss Islington (bot) in branch '3.8':
bpo-37741: make importlib.metadata docs discoverable through a module directive. (GH-25415)
a746fce
jaraco commentedon May 19, 2021
New changeset ab1c3d9 by Miss Islington (bot) in branch '3.9':
bpo-37741: make importlib.metadata docs discoverable through a module directive. (GH-25415) (GH-25417)
ab1c3d9
jaraco commentedon Jun 27, 2021
New changeset 17b9167 by Jason R. Coombs in branch '3.9':
[3.9] bpo-37741: make importlib.metadata docs discoverable through a module directive. (GH-25415) (GH-26500)
17b9167