summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2021-08-20 23:17:23 +0200
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-08-21 07:19:50 +0200
commit3341ca73ef8123bff516632d56a2fd9c0282412b (patch)
treeaebed24428d9e2ae070c74df9ea85705f7a14b9b /script
parent23e282ab01d947f13f9cebada854d44be2300478 (diff)
downloadastroid-git-3341ca73ef8123bff516632d56a2fd9c0282412b.tar.gz
Fix bug in bump_changelog for version with 10 in it
Diffstat (limited to 'script')
-rw-r--r--script/bump_changelog.py5
-rw-r--r--script/test_bump_changelog.py2
2 files changed, 4 insertions, 3 deletions
diff --git a/script/bump_changelog.py b/script/bump_changelog.py
index 2745d0ce..b11cf006 100644
--- a/script/bump_changelog.py
+++ b/script/bump_changelog.py
@@ -55,7 +55,6 @@ def get_next_version(version: str, version_type: VersionType) -> str:
def get_next_versions(version: str, version_type: VersionType) -> List[str]:
-
if version_type == VersionType.PATCH:
# "2.6.1" => ["2.6.2"]
return [get_next_version(version, VersionType.PATCH)]
@@ -72,9 +71,9 @@ def get_next_versions(version: str, version_type: VersionType) -> List[str]:
def get_version_type(version: str) -> VersionType:
- if version.endswith("0.0"):
+ if version.endswith(".0.0"):
version_type = VersionType.MAJOR
- elif version.endswith("0"):
+ elif version.endswith(".0"):
version_type = VersionType.MINOR
else:
version_type = VersionType.PATCH
diff --git a/script/test_bump_changelog.py b/script/test_bump_changelog.py
index 8de826f4..2a60e357 100644
--- a/script/test_bump_changelog.py
+++ b/script/test_bump_changelog.py
@@ -13,6 +13,8 @@ from bump_changelog import (
"version,version_type,expected_version,expected_versions",
[
["2.6.1", VersionType.PATCH, "2.6.2", ["2.6.2"]],
+ ["2.10.0", VersionType.MINOR, "2.11.0", ["2.11.0", "2.10.1"]],
+ ["10.1.10", VersionType.PATCH, "10.1.11", ["10.1.11"]],
[
"2.6.0",
VersionType.MINOR,