Skip to content

bump_version.py drops the rc/beta suffix when bumping a dev counter on a pre-release #2459

Closed

Description

@JarryShaw

Summary

util/bump_version.py's dev-counter bump doesn't preserve a pre-release segment: bump('1.6.0rc1.dev2') returns '1.6.0.dev3', silently dropping rc1. Under PEP 440, 1.6.0.dev3 sorts before 1.6.0rc1.dev2, so this is a version regression, not just a cosmetic loss.

Repro

from util.bump_version import bump
bump('1.6.0rc1.dev2')  # -> '1.6.0.dev3', expected something like '1.6.0rc1.dev3'

Surfaced during #2452's cross-review while checking is_devrelease/is_prerelease interactions; predates that PR and is unrelated to its gate logic.

Proposed fix

The dev-counter increment should preserve any pre-release segment already present (aN/bN/rcN) rather than reconstructing the version from just the release segment.

Activity

  1. added
    fixPull requests that fix a defect (fix: subject prefix)
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 30, 2026
  2. added this to the PyPCAPKit v1.5 milestone on Oct 30, 2026
  3. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixPull requests that fix a defect (fix: subject prefix)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions