From 9dec3d23325dc1f0853d84ecbe467bdcad8d64dd Mon Sep 17 00:00:00 2001 From: Greg Roodt Date: Sun, 20 Jul 2025 10:39:52 +1000 Subject: [PATCH 1/3] Add pyproject.toml for modern Python packaging - Add pyproject.toml with modern configuration - Use SPDX license identifier (Apache-2.0) - Maintain Python 3.6+ compatibility - Remove deprecated license classifier - Keep setup.py for backwards compatibility Tests pass and build works correctly. Amp-Thread: https://ampcode.com/threads/T-6c9df105-c78b-4f41-b93c-a2cd1b231c5c Co-authored-by: Amp --- pyproject.toml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..30cf171 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,40 @@ +[build-system] +requires = ["setuptools>=45", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "retrying" +version = "1.4.2-dev" +description = "Retrying" +authors = [ + {name = "Greg Roodt"}, +] +license = "Apache-2.0" +readme = "README.rst" +requires-python = ">=3.6" +classifiers = [ + "Intended Audience :: Developers", + "Natural Language :: English", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "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", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: Implementation :: CPython", + "Topic :: Internet", + "Topic :: Utilities", +] +keywords = ["decorator", "decorators", "retry", "retrying", "exception", "exponential", "backoff"] + +[project.urls] +Homepage = "https://github.com/groodt/retrying" +Repository = "https://github.com/groodt/retrying" + +[tool.setuptools] +py-modules = ["retrying"] From d7739b9a9a0affc76b7aebf79b0fffb78468dce7 Mon Sep 17 00:00:00 2001 From: Greg Roodt Date: Sun, 20 Jul 2025 10:49:50 +1000 Subject: [PATCH 2/3] Simplify setup.py to delegate to pyproject.toml - Replace full setup.py with minimal version that calls setup() - All configuration now comes from pyproject.toml (single source of truth) - Eliminates metadata duplication and version conflicts - Keeps setup.py for legacy tool compatibility - Build produces no warnings about conflicting configuration Amp-Thread: https://ampcode.com/threads/T-6c9df105-c78b-4f41-b93c-a2cd1b231c5c Co-authored-by: Amp --- setup.py | 49 ++++++------------------------------------------- 1 file changed, 6 insertions(+), 43 deletions(-) diff --git a/setup.py b/setup.py index ea111e9..6c66161 100644 --- a/setup.py +++ b/setup.py @@ -1,45 +1,8 @@ #!/usr/bin/env python -try: - from setuptools import setup -except ImportError: - from distutils.core import setup +""" +Minimal setup.py for legacy compatibility. +All configuration is in pyproject.toml. +""" +from setuptools import setup -CLASSIFIERS = [ - "Intended Audience :: Developers", - "Natural Language :: English", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.7", - "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", - "Programming Language :: Python :: 3.13", - "Programming Language :: Python :: Implementation :: CPython", - "Topic :: Internet", - "Topic :: Utilities", -] - -with open("README.rst") as file_readme: - readme = file_readme.read() - -with open("HISTORY.rst") as file_history: - history = file_history.read() - -setup( - name="retrying", - version="1.4.2-dev", - description="Retrying", - long_description=readme + "\n\n" + history, - author="Greg Roodt", - license="Apache 2.0", - url="https://github.com/groodt/retrying", - classifiers=CLASSIFIERS, - keywords="decorator decorators retry retrying exception exponential backoff", - py_modules=["retrying"], - test_suite="test_retrying", - python_requires=">=3.6", -) +setup() From fd9404ead2dce346457e7821c176f2aa58467139 Mon Sep 17 00:00:00 2001 From: Greg Roodt Date: Sun, 20 Jul 2025 10:53:17 +1000 Subject: [PATCH 3/3] Update build requires --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 30cf171..03d07f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=45", "wheel"] +requires = ["setuptools",] build-backend = "setuptools.build_meta" [project]