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
From my reading the section is a step-by-step guide, and the import is in the previous step, and so, repeating it is not necessary. If we were to include the setup in each codeblock, it seems like we should include the venv creation and python -m pip install wheel too?
@StanFromIreland I was follwing it as a step-by-step guide indeed, but the previous codeblock imports only version, but not metadata. It is easy to figure out, so not a big blocker, but explicit is better than implict :)
It could be changed to import both on the previous line too, to
from importlib.metadata import version, metadata
but that is maybe less intuitive given the context
I'd like to take this one. The fix should be straightforward - adding from importlib.metadata import metadata before the example code in the overview section. I'll submit a PR shortly.
Activity
StanFromIreland commentedon Dec 2, 2025
From my reading the section is a step-by-step guide, and the import is in the previous step, and so, repeating it is not necessary. If we were to include the setup in each codeblock, it seems like we should include the venv creation and
python -m pip install wheeltoo?lubianat commentedon Dec 2, 2025
@StanFromIreland I was follwing it as a step-by-step guide indeed, but the previous codeblock imports only
version, but notmetadata. It is easy to figure out, so not a big blocker, but explicit is better than implict :)It could be changed to import both on the previous line too, to
from importlib.metadata import version, metadatabut that is maybe less intuitive given the context
StanFromIreland commentedon Dec 2, 2025
Ah, I had not read closely enough, thank you. Yes I agree we should update it.
Yashp002 commentedon Dec 3, 2025
I'd like to take this one. The fix should be straightforward - adding
from importlib.metadata import metadatabefore the example code in the overview section. I'll submit a PR shortly.gh-142197: Doc: Add missing import statement in importlib.metadata ov…
[3.13] gh-142197: Doc: Add missing import statement in importlib.meta…
[3.14] gh-142197: Doc: Add missing import statement in importlib.meta…
[3.15] gh-142197: Doc: Add missing import statement in importlib.meta…
pythongh-142197: Doc: Add missing import statement in importlib.metad…
pythongh-142197: Doc: Add missing import statement in importlib.metad…