raulcd commented on code in PR #41041:
URL: https://github.com/apache/arrow/pull/41041#discussion_r1606059829
##########
python/pyproject.toml:
##########
@@ -24,7 +24,59 @@ requires = [
# continue using oldest-support-numpy.
"oldest-supported-numpy>=0.14; python_version<'3.9'",
"numpy>=1.25; python_version>='3.9'",
- "setuptools_scm",
- "setuptools >= 40.1.0",
+ # configuring setuptools_scm in pyproject.toml requires
+ # versions released after 2022
+ "setuptools_scm[toml]>=8",
+ "setuptools>=64",
"wheel"
]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "pyarrow"
+dynamic = ["version"]
+requires-python = ">=3.8"
+description = "Python library for Apache Arrow"
+readme = {file = "README.md", content-type = "text/markdown"}
+license = {text = "Apache Software License"}
+classifiers = [
+ 'License :: OSI Approved :: Apache Software License',
+ 'Programming Language :: Python :: 3.8',
+ 'Programming Language :: Python :: 3.9',
+ 'Programming Language :: Python :: 3.10',
+ 'Programming Language :: Python :: 3.11',
+ 'Programming Langauge :: Python :: 3.12',
+]
+maintainers = [
+ {name = "Apache Arrow Developers", email = "[email protected]"}
+]
+
+[project.urls]
+Homepage = "https://arrow.apache.org/"
+Documentation = "https://arrow.apache.org/docs/python"
+Repository = "https://github.com/apache/arrow"
+Issues = "https://github.com/apache/arrow/issues"
+
+[project.optional-dependencies]
+test = [
+ 'pytest',
+ 'hypothesis',
+ 'cffi',
+ 'pytz'
+]
+
+[tool.setuptools]
+zip-safe=false
+include-package-data=true
+
+[tool.setuptools.packages.find]
+where = ["."]
+
+[tool.setuptools.package-data]
+pyarrow = ["*.pxd", "*.pyx", "includes/*.pxd"]
+
+[tool.setuptools_scm]
+root = '..'
+version_file = 'pyarrow/_generated_version.py'
+version_scheme = 'guess-next-dev'
+git_describe_command = 'git describe --dirty --tags --long --match
"apache-arrow-[0-9]*.*"'
Review Comment:
Should we have a fallback version similar to what we had here for out of
source builds as we had previously?
https://github.com/apache/arrow/blob/main/python/setup.py#L355-L361
```suggestion
git_describe_command = 'git describe --dirty --tags --long --match
"apache-arrow-[0-9]*.*"'
fallback_version = '17.0.0a0'
```
I've tried the above locally and this would fix the existing issues event
though we should follow up if this is what we want to do on our builds as
@jorisvandenbossche suggested
[here](https://github.com/apache/arrow/issues/41429#issuecomment-2118659341):
We also should update the bump_versions script to update this instead of
setup.py and probably the tests for bump_versions (I haven't tested the snippet
below but just to give an idea of what I mean):
```diff
diff --git a/dev/release/utils-prepare.sh b/dev/release/utils-prepare.sh
index 5136708..bdf9cd7 100644
--- a/dev/release/utils-prepare.sh
+++ b/dev/release/utils-prepare.sh
@@ -26,10 +26,12 @@ update_versions() {
release)
local version=${base_version}
local r_version=${base_version}
+ local python_version=${base_version}
;;
snapshot)
local version=${next_version}-SNAPSHOT
local r_version=${base_version}.9000
+ local python_version=${next_version}a0
;;
esac
local major_version=${version%%.*}
@@ -110,10 +112,10 @@ update_versions() {
pushd "${ARROW_DIR}/python"
sed -i.bak -E -e \
- "s/^default_version = '.+'/default_version = '${version}'/" \
- setup.py
- rm -f setup.py.bak
- git add setup.py
+ "s/^fallback_version = '.+'/fallback_version = '${python_version}'/" \
+ pyproject.toml
+ rm -f pyproject.toml.bak
+ git add pyproject.toml
sed -i.bak -E -e \
"s/^set\(PYARROW_VERSION \".+\"\)/set(PYARROW_VERSION \"${version}\")/"
\
CMakeLists.txt
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]