From 03dd5e1fdd2a7b1e612d51baecc092efd0abc497 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Sat, 15 Aug 2026 13:05:25 +0200 Subject: [PATCH] feat: move metadata from setup.py to pyproject.toml. --- .pre-commit-config.yaml | 2 +- news/+setup-to-pyproject.internal | 2 ++ pyproject.toml | 57 ++++++++++++++++++++++++++++++ setup.py | 58 ++----------------------------- 4 files changed, 62 insertions(+), 57 deletions(-) create mode 100644 news/+setup-to-pyproject.internal diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 79d6a0b..06c97ca 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -69,7 +69,7 @@ repos: rev: "0.24.2" hooks: - id: check-python-versions - args: ['--only', 'setup.py,tox.ini'] + args: ['--only', 'pyproject.toml,tox.ini'] - repo: https://github.com/collective/i18ndude rev: "6.3.0" hooks: diff --git a/news/+setup-to-pyproject.internal b/news/+setup-to-pyproject.internal new file mode 100644 index 0000000..72ce34a --- /dev/null +++ b/news/+setup-to-pyproject.internal @@ -0,0 +1,2 @@ +Move package metadata from ``setup.py`` to ``pyproject.toml``. +[plone devs] diff --git a/pyproject.toml b/pyproject.toml index d6d4b32..1ca7b3e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,64 @@ [build-system] requires = ["setuptools>=68.2,<83", "wheel"] +# START-MARKER-MANUAL-CONFIG +# Anything from here until END-MARKER-MANUAL-CONFIG +# will be kept by plone.meta + +[project] +name = "plone.browserlayer" +version = "4.0.1.dev0" +description = "Browser layer management for Zope applications" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Web Environment", + "Framework :: Plone", + "Framework :: Plone :: 6.2", + "Framework :: Plone :: Core", + "Framework :: Zope :: 5", + "Operating System :: OS Independent", + "Programming Language :: Python", + "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", +] +license = "GPL-2.0-only" +dynamic = ["readme"] +requires-python = ">=3.10" +authors = [ + {name = "Plone Foundation",email = "plone-developers@lists.sourceforge.net"}, +] +maintainers = [ + {name = "Plone Foundation and contributors",email = "plone-developers@lists.sourceforge.net"}, +] +dependencies = [ + "Products.CMFCore", + "Products.GenericSetup", + "Zope", + "zope.component", + "zope.interface", + "zope.traversing", +] +keywords = ["plone", "browser", "layer"] + +[project.optional-dependencies] +test = [ + "plone.app.testing", + "plone.testing", + "transaction", + "zope.event", +] + +[project.urls] +Source = "https://github.com/plone/plone.browserlayer" +Issues = "https://github.com/plone/Products.CMFPlone/issues" +Changelog = "https://github.com/plone/plone.browserlayer/blob/master/CHANGES.rst" +[tool.setuptools.dynamic] +readme = {file = ["README.rst", "CHANGES.rst"]} +# END-MARKER-MANUAL-CONFIG [tool.towncrier] directory = "news/" diff --git a/setup.py b/setup.py index 3c7c438..d5dbbc6 100644 --- a/setup.py +++ b/setup.py @@ -1,58 +1,4 @@ -from pathlib import Path from setuptools import setup -version = "4.0.1.dev0" - -long_description = ( - f"{Path('README.rst').read_text()}\n{Path('CHANGES.rst').read_text()}" -) - -setup( - name="plone.browserlayer", - version=version, - description="Browser layer management for Zope applications", - long_description=long_description, - long_description_content_type="text/x-rst", - # Get more strings from - # https://pypi.org/classifiers/ - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Environment :: Web Environment", - "Framework :: Plone", - "Framework :: Plone :: 6.2", - "Framework :: Plone :: Core", - "Framework :: Zope :: 5", - "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", - "Operating System :: OS Independent", - "Programming Language :: Python", - "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", - ], - python_requires=">=3.10", - keywords="plone browser layer", - author="Plone Foundation", - author_email="plone-developers@lists.sourceforge.net", - url="https://github.com/plone/plone.browserlayer", - license="GPL version 2", - include_package_data=True, - zip_safe=False, - extras_require=dict( - test=[ - "plone.app.testing", - "plone.testing", - "transaction", - "zope.event", - ] - ), - install_requires=[ - "zope.component", - "zope.interface", - "zope.traversing >= 3.9.0", - "Products.CMFCore", - "Products.GenericSetup>=1.4", - "Zope", - ], -) +# See pyproject.toml for package metadata +setup()