You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/06/03 14:44:04 UTC

[GitHub] [arrow] kszucs commented on a change in pull request #7327: ARROW-9014: [Packaging] Bump the minor part of the automatically generated version in crossbow

kszucs commented on a change in pull request #7327:
URL: https://github.com/apache/arrow/pull/7327#discussion_r434622258



##########
File path: dev/tasks/crossbow.py
##########
@@ -700,13 +700,23 @@ def get_version(root, **kwargs):
     subprojects, e.g. apache-arrow-js-XXX tags.
     """
     from setuptools_scm.git import parse as parse_git_version
-    from setuptools_scm.version import guess_next_version
 
+    # query the calculated version based on the git tags
     kwargs['describe_command'] = (
         'git describe --dirty --tags --long --match "apache-arrow-[0-9].*"'
     )
     version = parse_git_version(root, **kwargs)
-    return version.format_next_version(guess_next_version)
+
+    # increment the minor version, because there can be patch releases created
+    # from maintenance branches where the tags are uncreachbe 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))
+    major, minor, patch = map(int, match.groups())
+
+    # the bumped version number after 0.17.x will be 0.18.0.dev300
+    return "{}.{}.{}.dev{}".format(major, minor + 1, patch, version.distance)

Review comment:
       Since the packaging builds are executed from the master branch we should have patch equal to zero.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org