From af0b608fcdc950e614f00183e611cd54f8bcd285 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Wed, 1 Feb 2023 17:38:49 -0600 Subject: [PATCH 1/5] update regex to match all iterations --- .bumpversion.cfg | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 4db0c9a0c58..8501077e90e 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,12 +1,14 @@ [bumpversion] current_version = 1.5.0a1 -parse = (?P\d+) - \.(?P\d+) - \.(?P\d+) - ((?Pa|b|rc) - (?P
\d+)  # pre-release version num
-	)(\.(?P[a-z..0-9]+)
+parse = (?P[\d]+)
+	\.(?P[\d]+)
+	\.(?P[\d]+)
+	(((?Pa|b|rc)
+	?(?P
[\d]+?))
+	\.?(?P[a-z..0-9]+\+[a-z]+)?
 	)?
+
+
 serialize =
 	{major}.{minor}.{patch}{prekind}{pre}.{nightly}
 	{major}.{minor}.{patch}{prekind}{pre}

From 4ac3dc51ed698b8a50edf9f52deca78a2021f887 Mon Sep 17 00:00:00 2001
From: Emily Rockman 
Date: Thu, 2 Feb 2023 10:03:20 -0600
Subject: [PATCH 2/5] convert to num to match all adapters

---
 .bumpversion.cfg | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/.bumpversion.cfg b/.bumpversion.cfg
index 8501077e90e..b1d96bd356e 100644
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -4,14 +4,12 @@ parse = (?P[\d]+)
 	\.(?P[\d]+)
 	\.(?P[\d]+)
 	(((?Pa|b|rc)
-	?(?P
[\d]+?))
+	?(?P[\d]+?))
 	\.?(?P[a-z..0-9]+\+[a-z]+)?
 	)?
-
-
 serialize =
-	{major}.{minor}.{patch}{prekind}{pre}.{nightly}
-	{major}.{minor}.{patch}{prekind}{pre}
+	{major}.{minor}.{patch}{prekind}{num}.{nightly}
+	{major}.{minor}.{patch}{prekind}{num}
 	{major}.{minor}.{patch}
 commit = False
 tag = False
@@ -25,7 +23,7 @@ values =
 	rc
 	final
 
-[bumpversion:part:pre]
+[bumpversion:part:num]
 first_value = 1
 
 [bumpversion:part:nightly]

From 8a7ffe619b01d54ac2ce789f3f9579913a0b651e Mon Sep 17 00:00:00 2001
From: Emily Rockman 
Date: Thu, 2 Feb 2023 11:15:59 -0600
Subject: [PATCH 3/5] add comments, remove extra .

---
 .bumpversion.cfg | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/.bumpversion.cfg b/.bumpversion.cfg
index b1d96bd356e..44275e98444 100644
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,11 +1,14 @@
 [bumpversion]
 current_version = 1.5.0a1
-parse = (?P[\d]+)
-	\.(?P[\d]+)
-	\.(?P[\d]+)
-	(((?Pa|b|rc)
-	?(?P[\d]+?))
-	\.?(?P[a-z..0-9]+\+[a-z]+)?
+
+# expected matches: `1.5.0`, `1.5.0a1`, `1.5.0a1.dev123457+nightly`
+# excepted failures: `1`, `1.5`, `1.5.2-a1`
+parse = (?P[\d]+) # major version number
+	\.(?P[\d]+) # minor version number
+	\.(?P[\d]+) # patch version number
+	(((?Pa|b|rc) # optional pre-release type
+	?(?P[\d]+?)) # optional pre-release version number
+	\.?(?P[a-z0-9]+\+[a-z]+)? # optional nightly release indicator
 	)?
 serialize =
 	{major}.{minor}.{patch}{prekind}{num}.{nightly}

From 2463bc0f353c23cf7eef55b26dbfebfc473b390a Mon Sep 17 00:00:00 2001
From: Emily Rockman 
Date: Thu, 2 Feb 2023 11:34:48 -0600
Subject: [PATCH 4/5] clarify with more comments

---
 .bumpversion.cfg | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/.bumpversion.cfg b/.bumpversion.cfg
index 44275e98444..1d63e86de57 100644
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,8 +1,11 @@
 [bumpversion]
 current_version = 1.5.0a1
 
+# `parse` allows parsing the version into the parts we need to check.  There are some
+# unnamed groups and that's okay because they do not need to be audited.  If any part
+# of the version passed in does not match the regex, it will fail.
 # expected matches: `1.5.0`, `1.5.0a1`, `1.5.0a1.dev123457+nightly`
-# excepted failures: `1`, `1.5`, `1.5.2-a1`
+# excepted failures: `1`, `1.5`, `1.5.2-a1`, `text1.5.0`
 parse = (?P[\d]+) # major version number
 	\.(?P[\d]+) # minor version number
 	\.(?P[\d]+) # patch version number

From 70f5a917bf5e652fee170275f2af4de11194b4ab Mon Sep 17 00:00:00 2001
From: Emily Rockman 
Date: Thu, 2 Feb 2023 11:43:47 -0600
Subject: [PATCH 5/5] Update .bumpversion.cfg

Co-authored-by: Nathaniel May 
---
 .bumpversion.cfg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.bumpversion.cfg b/.bumpversion.cfg
index 1d63e86de57..ad2a19955f1 100644
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -3,7 +3,7 @@ current_version = 1.5.0a1
 
 # `parse` allows parsing the version into the parts we need to check.  There are some
 # unnamed groups and that's okay because they do not need to be audited.  If any part
-# of the version passed in does not match the regex, it will fail.
+# of the version passed and does not match the regex, it will fail.
 # expected matches: `1.5.0`, `1.5.0a1`, `1.5.0a1.dev123457+nightly`
 # excepted failures: `1`, `1.5`, `1.5.2-a1`, `text1.5.0`
 parse = (?P[\d]+) # major version number