← Back to Pull requests

Join a multi-line description into a single-line `Summary` #3332

Closed
unknown closed this pull request without merging on Oct 20, 2026 13:52 UTC
View on GitHub
unknown unknown commented on Oct 18, 2026 12:01 UTC
Author

A multi-line package.description in Cargo.toml (easy to get with a """ string) or project.description in pyproject.toml is written to METADATA / PKG-INFO with its line breaks. The break ends the header block, so every field after Summary is read as part of the long description: Keywords, Author, License-Expression, Requires-Python, Description-Content-Type and Project-URL.

For a bin crate with

# Cargo.toml
description = """
A test project
written in Rust
"""

# pyproject.toml
[project]
requires-python = ">=3.9"
dynamic = ["version", "description"]

maturin sdist on main writes this PKG-INFO:

Summary: A test project
written in Rust
Requires-Python: >=3.9

and packaging.metadata.parse_email reads it as summary='A test project', requires_python=None. Installers lose the Requires-Python bound. packaging.metadata.Metadata.from_raw also rejects the value itself with 'summary' must be a single line.

Summary is a one-line field, so the description is now split into lines, each line is trimmed, blank lines are dropped and the rest is joined with a space. That is what hatchling does with project.description. The upload form reads the same summary value, so it is fixed too. A single-line description is only trimmed, as the Cargo.toml one already was. With the change the same project gives Summary: A test project written in Rust followed by Requires-Python: >=3.9, and parse_email returns both.

The guide's dynamic-metadata list now says that line breaks are joined. Changelog.md is left alone because AGENTS.md says git-cliff generates it.

Tests

  • New metadata::tests::test_multiline_description_from_cargo_toml (an expect! snapshot of the full METADATA) and test_multiline_description_from_pyproject_toml. Both fail on main and pass with the change.

  • cargo test --lib: 284 passed.

  • cargo fmt --all -- --check and cargo clippy --tests --all-features -- -D warnings are clean.

  • pre-commit run --files src/metadata.rs guide/src/metadata.md passes. cargo-deny was skipped because it is not installed locally, and no dependencies changed.

  • Not run: the integration suites (tests/run.rs, tests/cli.rs). No test crate has a multi-line description, so their outputs should not change.
  • Diff: 288 lines (+216 / -72) across 3 files Reviewer: messense Review duration: 2991m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 288 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.339
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3332"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.8% (MEDIUM) · Higher = larger blast radius
    39.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.7% · Safe to merge
    15.7%
    Repository