Skip to content

Clarify handling of script metadata#2089

Open
pfmoore wants to merge 1 commit into
pypa:mainfrom
pfmoore:script_metadata
Open

Clarify handling of script metadata#2089
pfmoore wants to merge 1 commit into
pypa:mainfrom
pfmoore:script_metadata

Conversation

@pfmoore

@pfmoore pfmoore commented Jul 12, 2026

Copy link
Copy Markdown
Member

The specification states that only top-level comments define script metadata. But recognising precisely top-level comments is difficult, and requires a full Python parse, which (for example) the canonical regex does not do.

Clarify that tools MAY use a simple textual scan, like the regex does, but that users must not rely on comments within other Python constructs being ignored.

See https://discuss.python.org/t/clarify-that-pep-723-inline-script-metadata-recognition-is-textual/108089 for a discussion of this issue.


📚 Documentation preview 📚: https://python-packaging-user-guide--2089.org.readthedocs.build/en/2089/

@pfmoore

pfmoore commented Jul 12, 2026

Copy link
Copy Markdown
Member Author

The linkcheck failure appears to only be for files I haven't changed...

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant