From 2d4c80b3544b4d8bc8633058d130bafe5c93ba2a Mon Sep 17 00:00:00 2001 From: Hyunseok Seo Date: Sat, 13 Jul 2024 05:33:21 +0900 Subject: [PATCH] GH-43114: [Archery][Dev] Support setuptools-scm >= 8.0.0 (#43156) ### Rationale for this change The update to `setuptools-scm` version 8.0.0 or higher ensures compatibility for Archery. ### What changes are included in this PR? - Added `Configuration` objects to handle necessary parameters (`get_describe_command`) - Fixed the `parse_git_version` function to align with the new version of `setuptools_scm` - Updated `setuptools_scm` requirement to version 8.0.0 or higher ### Are these changes tested? Yes, tested by CI. ### Are there any user-facing changes? No. * GitHub Issue: #43114 Authored-by: Hyunseok Seo Signed-off-by: Sutou Kouhei --- dev/archery/archery/crossbow/core.py | 9 ++++++++- dev/archery/setup.py | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dev/archery/archery/crossbow/core.py b/dev/archery/archery/crossbow/core.py index 0b5d242bbaccf..4e6b42e485c0c 100644 --- a/dev/archery/archery/crossbow/core.py +++ b/dev/archery/archery/crossbow/core.py @@ -746,12 +746,19 @@ 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 import Configuration # 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) + + # Create a Configuration object with necessary parameters + config = Configuration( + git_describe_command=kwargs['describe_command'] + ) + + version = parse_git_version(root, config=config, **kwargs) tag = str(version.tag) # We may get a development tag for the next version, such as "5.0.0.dev0", diff --git a/dev/archery/setup.py b/dev/archery/setup.py index cd3e2e9ca0834..f87316dcc7ab9 100755 --- a/dev/archery/setup.py +++ b/dev/archery/setup.py @@ -34,7 +34,7 @@ extras = { 'benchmark': ['pandas'], 'crossbow': ['github3.py', jinja_req, 'pygit2>=1.14.0', 'requests', - 'ruamel.yaml', 'setuptools_scm<8.0.0'], + 'ruamel.yaml', 'setuptools_scm>=8.0.0'], 'crossbow-upload': ['github3.py', jinja_req, 'ruamel.yaml', 'setuptools_scm'], 'docker': ['ruamel.yaml', 'python-dotenv'],