Skip to content

fix: add --ignore-missing-version flag for glob patterns#282

Open
maimul wants to merge 1 commit into
c4urself:masterfrom
maimul:fix/267-ignore-missing-version
Open

fix: add --ignore-missing-version flag for glob patterns#282
maimul wants to merge 1 commit into
c4urself:masterfrom
maimul:fix/267-ignore-missing-version

Conversation

@maimul

@maimul maimul commented May 30, 2026

Copy link
Copy Markdown

Problem

When using glob patterns in [bumpversion:glob:...] sections, some matched files may not contain the version string. bumpversion currently raises VersionNotFoundException and aborts — there's no way to say "skip files that don't have the version".

Fix

  • Add --ignore-missing-version CLI flag
  • Add ignore_missing_version boolean to the config-file boolean-parsing loop (so it can be set persistently in .bumpversion.cfg)
  • Import VersionNotFoundException in cli.py (it was only used in utils.py)
  • Update _check_files_contain_version to catch the exception and log a warning instead of re-raising when the flag is set

Usage

bumpversion patch --ignore-missing-version

Or in config:

[bumpversion]
ignore_missing_version = True

Fixes #267

When using glob patterns, some matched files may not contain the version
string. Previously bumpversion would crash with VersionNotFoundException
for any such file. This adds --ignore-missing-version (also settable via
ignore_missing_version = True in config) which logs a warning and skips
files that don't contain the expected version string.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature request: option to ignore VersionNotFoundException

1 participant