From ab076e8d7673b8579497f11802ba32be6f348ecf Mon Sep 17 00:00:00 2001 From: anjakefala Date: Fri, 5 Apr 2024 10:32:54 -0700 Subject: [PATCH] GH-37929: [Python] begin moving static settings to pyproject.toml --- python/pyproject.toml | 45 +++++++++++++++++++++++++++++++++++++++++-- python/setup.py | 29 +--------------------------- 2 files changed, 44 insertions(+), 30 deletions(-) diff --git a/python/pyproject.toml b/python/pyproject.toml index 1588e690a7247..3ab270eb64e3d 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -24,7 +24,48 @@ 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>=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 = "dev@arrow.apache.org"} +] + +[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" + +[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] diff --git a/python/setup.py b/python/setup.py index ce6996dc1d439..2e6ca7c4e5a78 100755 --- a/python/setup.py +++ b/python/setup.py @@ -480,11 +480,7 @@ 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 @@ -495,32 +491,9 @@ def has_ext_modules(foo): 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_file': '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'], - python_requires='>=3.8', - description='Python library for Apache Arrow', - long_description=long_description, - long_description_content_type='text/markdown', - 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 Language :: Python :: 3.12', - ], - license='Apache License, Version 2.0', - maintainer='Apache Arrow Developers', - maintainer_email='dev@arrow.apache.org', test_suite='pyarrow.tests', - url='https://arrow.apache.org/', - project_urls={ - 'Documentation': 'https://arrow.apache.org/docs/python', - 'Source': 'https://github.com/apache/arrow', - }, )