Skip to content

Commit ba0fba9

Browse files
bump: version 2.42.1 → 2.42.2a0
1 parent b328f6a commit ba0fba9

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repos:
1414
- id: no-commit-to-branch
1515

1616
- repo: https://github.com/commitizen-tools/commitizen
17-
rev: v2.42.1 # automatically updated by Commitizen
17+
rev: v2.42.2a0 # automatically updated by Commitizen
1818
hooks:
1919
- id: commitizen
2020
- id: commitizen-branch

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11

2+
## v2.42.2a0 (2023-03-10)
3+
4+
### Fix
5+
6+
- bump changelog for prerelease without commits
7+
28
## v2.42.1 (2023-02-25)
39

410
### Fix

commitizen/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.42.1"
1+
__version__ = "2.42.2a0"

commitizen/commands/changelog.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from operator import itemgetter
44
from typing import Callable, Dict, List, Optional
55

6-
from packaging.version import parse
6+
from packaging.version import parse, Version
77

88
from commitizen import bump, changelog, defaults, factory, git, out
99
from commitizen.config import BaseConfig
@@ -42,7 +42,7 @@ def __init__(self, config: BaseConfig, args):
4242
self.current_version = (
4343
args.get("current_version") or self.config.settings.get("version") or ""
4444
)
45-
self.current_version_instance = parse(self.current_version)
45+
self.current_version_instance = Version(self.current_version) if self.current_version else None
4646
self.unreleased_version = args["unreleased_version"]
4747
self.change_type_map = (
4848
self.config.settings.get("change_type_map") or self.cz.change_type_map
@@ -154,7 +154,7 @@ def __call__(self):
154154
commits = git.get_commits(
155155
start=start_rev, end=end_rev, args="--author-date-order"
156156
)
157-
if not commits and not self.current_version_instance.is_prerelease:
157+
if not commits and (not self.current_version or not self.current_version_instance.is_prerelease):
158158
raise NoCommitsFoundError("No commits found")
159159

160160
tree = changelog.generate_tree_from_commits(

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tool.commitizen]
2-
version = "2.42.1"
2+
version = "2.42.2a0"
33
tag_format = "v$version"
44
version_files = [
55
"pyproject.toml:version",
@@ -30,7 +30,7 @@ exclude = '''
3030

3131
[tool.poetry]
3232
name = "commitizen"
33-
version = "2.42.1"
33+
version = "2.42.2a0"
3434
description = "Python commitizen client tool"
3535
authors = ["Santiago Fraire <santiwilly@gmail.com>"]
3636
license = "MIT"

0 commit comments

Comments
 (0)