Skip to content

Python: Support inline script metadata (PEP 723) #11946

@woodruffw

Description

@woodruffw

Is there an existing issue for this?

  • I have searched the existing issues

Feature description

Hello Dependabot maintainers! Thank you for creating Dependabot, it's a fantastic tool.

This is similar to #10478, but not the same: #10478 concerns uv and uv.lock specifically, while this is about inline script metadata, which is not specific to uv and involves individual Python source files, not uv.lock files.

TL;DR: Inline script metadata is a Python packaging standard that specifies an inline metadata format for Python scripts, which appears as a contiguous preamble comment at the head of a Python file (after the shebang). For example:

# /// script
# requires-python = ">=3.13"
# dependencies = [
#     "pre-commit==4.2.0",
#     "pytz==2025.2",
#     "requests==2.32.3",
#     "requests-cache==1.2.1",
# ]
# ///

This preamble comment is formatted as TOML and contains much of the same information as a pyproject.toml would, which Dependabot already supports. In particular, it supports a dependencies key that behaves the same as in pyproject.toml, and as exemplified above.

I would like Dependabot to support this preamble (detect /// script and /// as delimiters) for version updating purposes! Doing so should be able to reuse most of the existing pyproject.toml machinery; the main change is probably a small amount of pre- and post-processing to mold the dependency changes back into the comment preamble format.

Supporting this would be a huge boon for the Python ecosystem, which has increasingly come to rely on inline script metadata as a replacement for "sidecar" requirements.txt files.

Additional resources:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions