Skip to content

The --devrelease option in cz bump is not correctly incrementing the version #1367

Description

@gbaian10

Description

When executing cz bump -d 1 while at x.y.z.dev0, I got:

bump: version 0.2.0.dev0 → 0.2.0.dev1
tag to create: 0.2.0.dev1
increment detected: MINOR

No tag found to do an incremental changelog

My pyproject.toml has the following configuration:

[tool.commitizen]
version_provider = "uv"
update_changelog_on_bump = true
changelog_incremental = true

The issue seems to be with update_changelog_on_bump = true.
When I set this option to false, it correctly increments the version to 0.2.0.dev1, but it doesn't update the CHANGELOG.md.

Steps to reproduce

Set the pyproject.toml file to look like the example above.

The latest tag is 0.1.0.

  1. Commit a feat: 2
  2. Run cz bump -d 0
  3. Commit a feat: 3
  4. Runcz bump -d 1 (get an error)

Current behavior

Received an error output: No tag found to do an incremental changelog

Desired behavior

Upgrade the version to 0.2.0.dev1 and update the CHANGELOG.md

Screenshots

Step 1 + Step 2

Image
Output
Image

Step 3 + Step 4

Image
Output
Image

Environment

Commitizen Version: 4.4.1
Python Version: 3.13.2 (main, Feb 5 2025, 19:11:32) [Clang 19.1.6 ]
Operating System: Linux

Activity

  1. changed the title [-]`--devrelease` option is unable to correctly increment the version[/-] [+]The `--devrelease` option in `cz bump` is not correctly incrementing the version[/+] on Mar 3, 2025
  2. added theissue type on Apr 6, 2025
  3. Lee-W commented on Apr 6, 2025

    @Lee-W
    Member

    Hey, thanks for the detailed reproduction steps. I verify it it's a valid bug

  4. bassemkaroui commented on Apr 10, 2025

    @bassemkaroui

    I have the same issue

  5. senysenyseny16 commented on May 30, 2025

    @senysenyseny16

    the same issue

  6. added this to the 4.9.0 milestone on Jun 10, 2025
  7. modified the milestones: 4.9.0, 4.9.1, 4.9.2 on Sep 9, 2025
  8. pkucmus commented on Mar 16, 2026

    @pkucmus

    The problem is in

    _DEFAULT_VERSION_PARSER = re.compile(
    r"v?(?P<version>([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z.]+)?(\w+)?)"
    )

    That's not the correct reg exp for PEP440, here's one https://peps.python.org/pep-0440/#appendix-b-parsing-version-strings-with-regular-expressions

    I was able to fix that locally https://github.com/pkucmus/commitizen/tree/fix/1367-pep440-regexp but I have no idea how to fix all the unit tests that broke (in theory they shouldn't, right?)

  9. Andromeda-bit01 commented on May 8, 2026

    @Andromeda-bit01

    I am having the same issue, any updates?

  10. Lee-W commented on May 9, 2026

    @Lee-W
    Member

    not atm, feel free to send us a PR :)

  11. removed this from the 4.10.1 milestone on May 9, 2026
  12. SebassNoob commented on Sep 8, 2026

    @SebassNoob

    hello, im running into this issue too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions