You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose to add a new --ignore-missing-file, to ignore files that are referenced in the configuration file but not found by bump-my-version.
Why? Because all files having their own [[tool.bumpversion.files]] entry in the TOML configuration are required to be present on the file system.
Having this option will allow me to have a collection of search and replace patterns in a TOML that I can share across several projects of different kind. With this new --ignore-missing-file behaviour, each project will then naturally match patterns that can be apply to them and ignore the others.
The name --ignore-missing-file I propose is based on the new --ignore-missing-version that was implemented in #10.
$ bump-my-version replace --dry-run ./changelog.md
Specified version (2.17.8) does not match last tagged version (2.17.7)
Traceback (most recent call last):
File "~/.local/bin/bump-my-version", line 8, in <module>
sys.exit(cli())
^^^^^
File ".../click/core.py", line 1130, in __call__returnself.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../rich_click/rich_group.py", line 21, in main
rv =super().main(*args, standalone_mode=False, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../click/core.py", line 1055, in main
rv =self.invoke(ctx)
^^^^^^^^^^^^^^^^
File ".../click/core.py", line 1657, in invokereturn _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../click/core.py", line 1404, in invokereturn ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../click/core.py", line 760, in invokereturn __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../bumpversion/cli.py", line 498, in replace
modify_files(configured_files, version, next_version, ctx, dry_run)
File ".../bumpversion/files.py", line 193, in modify_files
_check_files_contain_version(files, current_version, context)
File ".../bumpversion/files.py", line 231, in _check_files_contain_version
f.contains_version(current_version, context)
File ".../bumpversion/files.py", line 50, in contains_versionifself.contains(search_expression):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../bumpversion/files.py", line 76, in containswithopen(self.path, "rt", encoding="utf-8") as f:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^FileNotFoundError: [Errno 2] No such file or directory: './citation.cff'
Instead, with the --ignore-missing-file, I expect the invokation above to not fail and have bump-my-version only report the citation.cff was not found and search and replace patterns simply skipped.
The text was updated successfully, but these errors were encountered:
0.8.0
3.11.4
Description
I propose to add a new
--ignore-missing-file
, to ignore files that are referenced in the configuration file but not found bybump-my-version
.Why? Because all files having their own
[[tool.bumpversion.files]]
entry in the TOML configuration are required to be present on the file system.Having this option will allow me to have a collection of search and replace patterns in a TOML that I can share across several projects of different kind. With this new
--ignore-missing-file
behaviour, each project will then naturally match patterns that can be apply to them and ignore the others.The name
--ignore-missing-file
I propose is based on the new--ignore-missing-version
that was implemented in #10.What I Did
Given this minimal project:
And with
./pyproject.toml
containing:The following command fails:
Instead, with the
--ignore-missing-file
, I expect the invokation above to not fail and have bump-my-version only report thecitation.cff
was not found and search and replace patterns simply skipped.The text was updated successfully, but these errors were encountered: