Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
python-check:
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
platform: [ubuntu-22.04, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
4 changes: 2 additions & 2 deletions commitizen/bump.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def find_increment(
def update_version_in_files(
current_version: str,
new_version: str,
files: Iterable[str],
version_files: Iterable[str],
*,
check_consistency: bool,
encoding: str,
Expand All @@ -77,7 +77,7 @@ def update_version_in_files(
"""
updated_files = []

for path, pattern in _resolve_files_and_regexes(files, current_version):
for path, pattern in _resolve_files_and_regexes(version_files, current_version):
current_version_found = False
bumped_lines = []

Expand Down
23 changes: 14 additions & 9 deletions commitizen/commands/bump.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,33 +302,38 @@ def __call__(self) -> None:
"[NO_COMMITS_TO_BUMP]\nThe commits found are not eligible to be bumped"
)

files: list[str] = []
updated_files: list[str] = []
dry_run = self.arguments["dry_run"]
if self.changelog_flag:
args = {
changelog_args = {
"unreleased_version": new_tag_version,
"template": self.template,
"extras": self.extras,
"incremental": True,
"dry_run": dry_run,
}
if self.changelog_to_stdout:
changelog_cmd = Changelog(self.config, {**args, "dry_run": True}) # type: ignore[typeddict-item]
changelog_cmd = Changelog(
self.config,
{**changelog_args, "dry_run": True}, # type: ignore[typeddict-item]
)
try:
changelog_cmd()
except DryRunExit:
pass

args["file_name"] = self.file_name
changelog_cmd = Changelog(self.config, args) # type: ignore[arg-type]
changelog_cmd = Changelog(
self.config,
{**changelog_args, "file_name": self.file_name}, # type: ignore[typeddict-item]
)
changelog_cmd()
files.append(changelog_cmd.file_name)
updated_files.append(changelog_cmd.file_name)

# Do not perform operations over files or git.
if dry_run:
raise DryRunExit()

files.extend(
updated_files.extend(
bump.update_version_in_files(
str(current_version),
str(new_version),
Expand Down Expand Up @@ -360,13 +365,13 @@ def __call__(self) -> None:
raise ExpectedExit()

# FIXME: check if any changes have been staged
git.add(*files)
git.add(*updated_files)
c = git.commit(message, args=self._get_commit_args())
if self.retry and c.return_code != 0 and self.changelog_flag:
# Maybe pre-commit reformatted some files? Retry once
logger.debug("1st git.commit error: %s", c.err)
logger.info("1st commit attempt failed; retrying once")
git.add(*files)
git.add(*updated_files)
c = git.commit(message, args=self._get_commit_args())
if c.return_code != 0:
err = c.err.strip() or c.out
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ testpaths = ["tests/"]

[tool.tox]
requires = ["tox>=4.22"]
env_list = ["3.9", "3.10", "3.11", "3.12", "3.13"]
env_list = ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]

[tool.tox.env_run_base]
description = "Run tests suite against Python {base_python}"
Expand Down