Skip to content

fix(schemes): recognize PEP 440 devrelease tags - #2109

Open
GatVit wants to merge 1 commit into
commitizen-tools:masterfrom
GatVit:fix/1367-pep440-devrelease
Open

GatVit wants to merge 1 commit into
commitizen-tools:masterfrom
GatVit:fix/1367-pep440-devrelease

Conversation

@GatVit

@GatVit GatVit commented Oct 13, 2026

Copy link
Copy Markdown

Description

cz bump --devrelease creates PEP 440 development release tags such as 0.2.0.dev1. The default version parser did not match those tags, so they were dropped from the version tag list. The next incremental changelog run then failed with No tag found to do an incremental changelog.

This PR replaces the default version parser regex with the one specified in PEP 440's appendix, while keeping the version group and the -next pre-release support that existing tag formats rely on. Now 0.2.0.dev1-style tags are recognized as version tags, and bumping a dev release twice updates the incremental changelog correctly.

Checklist

Was generative AI tooling used to co-author this PR?

  • Yes (please specify the tool below)

Code Changes

  • Add test cases to all the changes you introduce
  • Run uv run poe all locally to ensure this change passes linter check and tests
  • Manually test the changes:
    • Verify the feature/bug fix works as expected in real-world scenarios
    • Test edge cases and error conditions
    • Ensure backward compatibility is maintained
    • Document any manual testing steps performed
  • Update the documentation for the changes

Documentation Changes

  • Run uv run poe doc locally to ensure the documentation pages renders correctly
  • Check and fix any broken links (internal or external)

Expected Behavior

  • cz bump -d 0 on 0.1.0 creates tag 0.2.0.dev0 and a changelog entry
  • cz bump -d 1 on 0.2.0.dev0 creates tag 0.2.0.dev1 and updates the incremental changelog without error

Steps to Test This Pull Request

  1. Create a project with version_provider = "uv", update_changelog_on_bump = true, changelog_incremental = true
  2. Tag 0.1.0, commit feat: 2, run cz bump -d 0 --yes
  3. Commit feat: 3, run cz bump -d 1 --yes
  4. Both bumps succeed; changelog contains 0.2.0.dev0 and 0.2.0.dev1 sections

Additional Context

Fixes #1367

The default version parser did not match PEP 440 development release
tags such as 0.2.0.dev1. As a result, cz bump --devrelease
created tags that were not recognized as version tags, and the next
incremental changelog run failed with
"No tag found to do an incremental changelog".

Use the PEP 440 regular expression from the specification appendix,
while keeping the version group and the -next pre-release
support relied upon by existing tag formats.

Closes commitizen-tools#1367
@codecov

codecov Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.28%. Comparing base (2ebac02) to head (6a2c9ec).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2109   +/-   ##
=======================================
  Coverage   98.28%   98.28%           
=======================================
  Files          61       61           
  Lines        2864     2864           
=======================================
  Hits         2815     2815           
  Misses         49       49           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant