From 9fb0536d8480687835792cfa4be9ab8e5d9ee502 Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Thu, 6 Nov 2025 10:21:47 +0100 Subject: [PATCH 1/3] - Move all supported package metadata into ``pyproject.toml`` --- CHANGES.rst | 2 +- pyproject.toml | 43 +++++++++++++++++++++++++++++++++++++++++++ setup.py | 47 +---------------------------------------------- 3 files changed, 45 insertions(+), 47 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 86d94a8..0b274bc 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,7 +5,7 @@ 6.2 (unreleased) ================ -- Nothing changed yet. +- Move all supported package metadata into ``pyproject.toml``. 6.1 (2025-10-29) diff --git a/pyproject.toml b/pyproject.toml index 15302bf..ab8486a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,6 +9,46 @@ requires = [ ] build-backend = "setuptools.build_meta" +[project] +name = "ExtensionClass" +version = "6.2.dev0" +description = "Metaclass for subclassable extension types" +readme = "README.rst" +requires-python = ">=3.10" +license = "ZPL-2.1" +authors = [ + { name = "Zope Foundation and contributors", email = "zope-dev@zope.dev" }, +] +maintainers = [ + { name = "Plone Foundation and contributors", email = "zope-dev@zope.dev" }, +] +classifiers = [ + "Development Status :: 6 - Mature", + "Environment :: Web Environment", + "Framework :: Zope", + "Framework :: Zope :: 5", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", +] +dependencies = [] + +[project.optional-dependencies] +test = ["zope.testrunner"] + +[project.urls] +Issues = "https://github.com/zopefoundation/ExtensionClass/issues" +Source = "https://github.com/zopefoundation/ExtensionClass" +Changelog = "https://github.com/zopefoundation/ExtensionClass/blob/master/CHANGES.rst" + [tool.coverage.run] branch = true source = ["ExtensionClass"] @@ -39,3 +79,6 @@ source = [ ".tox/*/lib/python*/site-packages/", ".tox/pypy*/site-packages/", ] + +[tool.setuptools.packages.find] +where = ["src"] diff --git a/setup.py b/setup.py index a17ca91..4da604d 100644 --- a/setup.py +++ b/setup.py @@ -17,16 +17,9 @@ import platform from setuptools import Extension -from setuptools import find_packages from setuptools import setup -with open('README.rst') as f: - README = f.read() - -with open('CHANGES.rst') as f: - CHANGES = f.read() - # PyPy won't build the extension. py_impl = platform.python_implementation is_pypy = py_impl() == 'PyPy' @@ -49,42 +42,4 @@ include_dirs=['src']), ] -version = '6.2.dev0' - -setup( - name='ExtensionClass', - version=version, - url='https://github.com/zopefoundation/ExtensionClass', - license='ZPL-2.1', - description='Metaclass for subclassable extension types', - author='Zope Foundation and Contributors', - author_email='zope-dev@zope.dev', - long_description='\n\n'.join([README, CHANGES]), - packages=find_packages('src'), - package_dir={'': 'src'}, - classifiers=[ - "Development Status :: 6 - Mature", - "Environment :: Web Environment", - "Framework :: Zope :: 5", - "License :: OSI Approved :: Zope Public License", - "Operating System :: OS Independent", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Programming Language :: Python :: 3.14", - "Programming Language :: Python :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", - ], - ext_modules=ext_modules, - include_package_data=True, - zip_safe=False, - extras_require={ - 'test': [ - 'zope.testrunner', - ], - }, - python_requires='>=3.10', -) +setup(ext_modules=ext_modules) From abc12c6da971cda28ff0ab5736270e85717d8ea6 Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Thu, 6 Nov 2025 10:50:22 +0100 Subject: [PATCH 2/3] - small simplification and note --- setup.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 4da604d..f2357f8 100644 --- a/setup.py +++ b/setup.py @@ -21,10 +21,7 @@ # PyPy won't build the extension. -py_impl = platform.python_implementation -is_pypy = py_impl() == 'PyPy' - -if is_pypy: +if platform.python_implementation() == 'PyPy': ext_modules = [] else: ext_modules = [ @@ -42,4 +39,5 @@ include_dirs=['src']), ] +# See pyproject.toml for package metadata setup(ext_modules=ext_modules) From 46264179640ebf8d1ae28ef23455c1fe59d2e3b8 Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Thu, 6 Nov 2025 15:15:48 +0100 Subject: [PATCH 3/3] Remove unused section that reflects the default Co-authored-by: Maurits van Rees --- pyproject.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ab8486a..30adcfb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -79,6 +79,3 @@ source = [ ".tox/*/lib/python*/site-packages/", ".tox/pypy*/site-packages/", ] - -[tool.setuptools.packages.find] -where = ["src"]