Skip to content

Commit

Permalink
GH-43114: [Archery][Dev] Support setuptools-scm >= 8.0.0 (#43156)
Browse files Browse the repository at this point in the history
### 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 <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
llama90 authored Jul 12, 2024
1 parent bafb2d8 commit 2d4c80b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion dev/archery/archery/crossbow/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion dev/archery/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down

0 comments on commit 2d4c80b

Please sign in to comment.