jorisvandenbossche commented on code in PR #41041:
URL: https://github.com/apache/arrow/pull/41041#discussion_r1586061288
##########
python/pyproject.toml:
##########
@@ -24,7 +24,53 @@ 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"
+Changelog = "https://github.com/apache/arrow/blob/main/CHANGELOG.md"
Review Comment:
This is a very outdated file (which we should maybe remove, or if not keep
up to date, but that's for another issue), so I would not link to that.
(this is not a required entry, so I would just leave it out for now given we
don't have a clear one link to the changelog)
##########
python/setup.py:
##########
@@ -421,31 +421,6 @@ def get_outputs(self):
default_version.replace('-SNAPSHOT', 'a0')
-# See https://github.com/pypa/setuptools_scm#configuration-parameters
-scm_version_write_to_prefix = os.environ.get(
- 'SETUPTOOLS_SCM_VERSION_WRITE_TO_PREFIX', setup_dir)
-
-
-def parse_git(root, **kwargs):
- """
- Parse function for setuptools_scm that ignores tags for non-C++
- subprojects, e.g. apache-arrow-js-XXX tags.
- """
- from setuptools_scm.git import parse
- kwargs['describe_command'] =\
- 'git describe --dirty --tags --long --match "apache-arrow-[0-9]*.*"'
- return parse(root, **kwargs)
-
-
-def guess_next_dev_version(version):
- if version.exact:
- return version.format_with('{tag}')
- else:
- def guess_next_version(tag_version):
- return default_version.replace('-SNAPSHOT', '')
- return version.format_next_version(guess_next_version)
-
-
with open('README.md') as f:
long_description = f.read()
Review Comment:
This can be removed as well?
##########
python/setup.py:
##########
@@ -480,47 +455,14 @@ def has_ext_modules(foo):
setup(
- name='pyarrow',
packages=packages,
- zip_safe=False,
- package_data={'pyarrow': ['*.pxd', '*.pyx', 'includes/*.pxd']},
- include_package_data=True,
exclude_package_data=exclude_package_data,
distclass=BinaryDistribution,
# Dummy extension to trigger build_ext
ext_modules=[Extension('__dummy__', sources=[])],
cmdclass={
'build_ext': build_ext
},
- use_scm_version={
- 'root': os.path.dirname(setup_dir),
- 'parse': parse_git,
- 'write_to': os.path.join(scm_version_write_to_prefix,
- 'pyarrow/_generated_version.py'),
- 'version_scheme': guess_next_dev_version
- },
- setup_requires=['setuptools_scm', 'cython >= 0.29.31'] + setup_requires,
- install_requires=install_requires,
tests_require=['pytest', 'pandas', 'hypothesis'],
Review Comment:
I don't know if anyone is relying on this?
Given one shouldn't run the tests through setuptools (which is also
deprecated, I think), I think we can remove this as well (same for `test_suite`
below)
We could add a tests "extra" in pyproject.toml with those dependencies if we
want (although strictly speaking pandas is not actually a required test
dependency, we will skip tests if pandas is not installed. So if we do add this
extra, we should use an up to date list of actual test dependencies)
##########
python/setup.py:
##########
@@ -421,31 +421,6 @@ def get_outputs(self):
default_version.replace('-SNAPSHOT', 'a0')
-# See https://github.com/pypa/setuptools_scm#configuration-parameters
-scm_version_write_to_prefix = os.environ.get(
- 'SETUPTOOLS_SCM_VERSION_WRITE_TO_PREFIX', setup_dir)
-
-
-def parse_git(root, **kwargs):
- """
- Parse function for setuptools_scm that ignores tags for non-C++
- subprojects, e.g. apache-arrow-js-XXX tags.
- """
- from setuptools_scm.git import parse
- kwargs['describe_command'] =\
- 'git describe --dirty --tags --long --match "apache-arrow-[0-9]*.*"'
- return parse(root, **kwargs)
-
-
-def guess_next_dev_version(version):
- if version.exact:
- return version.format_with('{tag}')
- else:
- def guess_next_version(tag_version):
- return default_version.replace('-SNAPSHOT', '')
- return version.format_next_version(guess_next_version)
-
-
with open('README.md') as f:
long_description = f.read()
Review Comment:
Some other variables that can be cleaned up are `install_requires`,
`setup_requires` below, and `default_version` a bit above
--
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]