Skip to content

Commit

Permalink
[BACKPORT] 1.4.latest update regex to match all iterations (#6839) (#…
Browse files Browse the repository at this point in the history
…6846)

* update regex to match all iterations (#6839)

* update regex to match all iterations

* convert to num to match all adapters

* add comments, remove extra .

* clarify with more comments

* Update .bumpversion.cfg

Co-authored-by: Nathaniel May <nathaniel.may@fishtownanalytics.com>

---------

Co-authored-by: Nathaniel May <nathaniel.may@fishtownanalytics.com>
# Conflicts:
#	.bumpversion.cfg

* put back correct version

* put back correct version
  • Loading branch information
emmyoop authored Feb 6, 2023
1 parent 52be5ff commit f6926c0
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
[bumpversion]
current_version = 1.4.1
parse = (?P<major>\d+)
\.(?P<minor>\d+)
\.(?P<patch>\d+)
((?P<prekind>a|b|rc)
(?P<pre>\d+) # pre-release version num
)(\.(?P<nightly>[a-z..0-9]+)

# `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 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<major>[\d]+) # major version number
\.(?P<minor>[\d]+) # minor version number
\.(?P<patch>[\d]+) # patch version number
(((?P<prekind>a|b|rc) # optional pre-release type
?(?P<num>[\d]+?)) # optional pre-release version number
\.?(?P<nightly>[a-z0-9]+\+[a-z]+)? # optional nightly release indicator
)?
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
Expand All @@ -23,7 +29,7 @@ values =
rc
final

[bumpversion:part:pre]
[bumpversion:part:num]
first_value = 1

[bumpversion:part:nightly]
Expand Down

0 comments on commit f6926c0

Please sign in to comment.