Skip to content
Merged
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
21 changes: 12 additions & 9 deletions dev/archery/archery/crossbow/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,17 +640,20 @@ def get_version(root, **kwargs):
'git describe --dirty --tags --long --match "apache-arrow-[0-9].*"'
)
version = parse_git_version(root, **kwargs)

# increment the minor version, because there can be patch releases created
# from maintenance branches where the tags are unreachable from the
# master's HEAD, so the git command above generates 0.17.0.dev300 even if
# arrow has a never 0.17.1 patch release
pattern = r"^(\d+)\.(\d+)\.(\d+)$"
match = re.match(pattern, str(version.tag))
tag = str(version.tag)

# We may get a development tag for the next version, such as "5.0.0.dev0",
# or the tag of an already released version, such as "4.0.0".
# In the latter case, we need to increment the version so that the computed
# version comes after any patch release (the next feature version after
# 4.0.0 is 5.0.0).
pattern = r"^(\d+)\.(\d+)\.(\d+)"
match = re.match(pattern, tag)
major, minor, patch = map(int, match.groups())
if 'dev' not in tag:
major += 1

# the bumped version number after 0.17.x will be 0.18.0.dev300
return "{}.{}.{}.dev{}".format(major, minor + 1, patch, version.distance)
return "{}.{}.{}.dev{}".format(major, minor, patch, version.distance)


class Serializable:
Expand Down