Skip to content

release-please writes SemVer (not PEP 440) to pyproject.toml on prerelease bumps #830

@bokelley

Description

@bokelley

What happened

Release-please's Python release-type writes the raw SemVer version string to pyproject.toml's [project] version field, with no PEP 440 normalization for prerelease versions.

Observed on #817 (the v6.0.0-beta.1 release PR):

```
-version = "5.7.0"
+version = "6.0.0-beta.1" ← invalid PEP 440; PyPI rejects
```

Expected: version = "6.0.0b1" (PEP 440 form).

Worked around by hand-editing the release PR in commit 3e0f7e17 before merging, but the next prerelease bump will reproduce the same bug and need the same hand-edit. Need a permanent fix.

Background

The aao-ipr-bot flagged this on #804 (review comment). At the time we believed dropping the generic JSON extra-files updater would let the Python release-type's native pyproject.toml updater handle the conversion. That turned out to be wrong — the native updater also writes the raw SemVer string.

Options for a permanent fix

  1. Custom updater via extra-files. Use an extra-files entry with type: "generic" or type: "python" (if such a type exists in release-please's schema) that knows PEP 440. Worth checking release-please's docs for a Python-aware pyproject.toml updater.
  2. Post-bump GitHub Action. Add a step to the release-please workflow that runs after release-please opens/updates the release PR and normalizes the version. Cheap to write but adds a moving part.
  3. Upstream fix in release-please. File against googleapis/release-please — this looks like a real bug in the Python strategy. Risky from a timeline perspective.
  4. Switch off the prerelease line. Cut 6.0.0 GA without intermediate betas (won't work — we explicitly need beta testing on salesagent before GA).

I'd lean toward (2) as the immediate path and file (3) in parallel.

Acceptance

  • Next prerelease bump (6.0.0-beta.2, etc.) produces version = "6.0.0b2" in pyproject.toml automatically, no hand-edit required.
  • Stable version bumps still work (e.g., a future 6.0.0 GA cut produces version = "6.0.0").

Refs

Metadata

Metadata

Assignees

No one assigned

    Labels

    claude-triagedno-triageSkip the Claude triage bot — human or designated agent will handle this issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions