GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Add recommendation for "escaping" quoted inline script metadata · Issue #1835 · pypa/packaging.python.org Open DescriptionIssue DescriptionAs described in astral-sh/uv#12303, inline script metadata added naively to a multi-line string will be incorrectly detected as being actual inline script metadata when parsed in accordance with PEP 723 (since the parsing rules are written to be compatible with a basic regex instead of requiring a full Python parser). https://packaging.python.org/en/latest/specifications/inline-script-metadata/#recommendations should note the problem, and suggest ways to use Python's string quoting flexibility to avoid the misfire. For example, replacing: SOURCE_CODE = """ # /// script # dependencies = ["pydantic", "email-validator"] # /// import pydantic class Model(pydantic.BaseModel): email: pydantic.EmailStr print(Model(email='[email protected]')) """ with the following compile time string concatenation: SOURCE_CODE = (""" """ "# /// script" """ # dependencies = ["pydantic", "email-validator"] # /// import pydantic class Model(pydantic.BaseModel): email: pydantic.EmailStr print(Model(email='[email protected]')) """) Code of Conduct
Reacted by Karl Knechtel Activity
MetadataMetadataAssigneesLabelsNo labels ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |