Skip to content

gh-142197: Doc: Add missing import statement in importlib.metadata overview#142208

Open
Yashp002 wants to merge 6 commits intopython:mainfrom
Yashp002:metadata
Open

gh-142197: Doc: Add missing import statement in importlib.metadata overview#142208
Yashp002 wants to merge 6 commits intopython:mainfrom
Yashp002:metadata

Conversation

@Yashp002
Copy link
Copy Markdown
Contributor

@Yashp002 Yashp002 commented Dec 3, 2025

Fixes #142197

Added missing from importlib.metadata import metadata import statement before the example code that uses metadata('wheel') in the overview section.

The documentation showed usage of the metadata() function without first importing it, causing a NameError when users tried to follow the example. This change ensures the example code is runnable as-is.


📚 Documentation preview 📚: https://cpython-previews--142208.org.readthedocs.build/

@bedevere-app bedevere-app bot added docs Documentation in the Doc dir skip news labels Dec 3, 2025
@github-project-automation github-project-automation bot moved this to Todo in Docs PRs Dec 3, 2025
@Yashp002 Yashp002 changed the title Doc: Add missing import statement in importlib.metadata overview gh-142197: Doc: Add missing import statement in importlib.metadata overview Dec 3, 2025
Copy link
Copy Markdown
Member

@StanFromIreland StanFromIreland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert unrelated changes in different files.


You can get the :ref:`metadata for a distribution <metadata>`::

>>> list(metadata('wheel')) # doctest: +SKIP
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you changing the indentation?

picnixz
picnixz previously requested changes Dec 6, 2025
Comment on lines 93 to +94
You can get the :ref:`metadata for a distribution <metadata>`::

>>> from importlib.metadata import metadata # doctest: +SKIP
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please leave a blank line before >>>

@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Dec 6, 2025

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Yashp002 and others added 2 commits December 9, 2025 21:55
Co-authored-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com>
@Yashp002
Copy link
Copy Markdown
Contributor Author

I have made the requested changes; please review again.

@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Dec 10, 2025

Thanks for making the requested changes!

@picnixz: please review the changes made to this pull request.

@bedevere-app bedevere-app bot requested a review from picnixz December 10, 2025 11:41
@Yashp002
Copy link
Copy Markdown
Contributor Author

@picnixz , just checking in, could you review my PR and let me know if there's anything more to fix?

@picnixz
Copy link
Copy Markdown
Member

picnixz commented Mar 21, 2026

Ok GH is telling me I have a pending review but this change is good.

@picnixz picnixz requested a review from FFY00 as a code owner March 21, 2026 13:48
@picnixz picnixz enabled auto-merge (squash) March 21, 2026 13:49
@picnixz picnixz disabled auto-merge March 21, 2026 13:49
@picnixz picnixz enabled auto-merge (squash) March 21, 2026 13:49
@picnixz picnixz disabled auto-merge March 21, 2026 13:50
@picnixz
Copy link
Copy Markdown
Member

picnixz commented Mar 21, 2026

As I am on mobile I do not trust the GH UI so I will let another core dev merge this one

@picnixz picnixz added awaiting merge needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes and removed awaiting review labels Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge docs Documentation in the Doc dir needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

import.metadata overview missing import statement

4 participants