Skip to content

Commit 1178440

Browse files
authored
Convert setup py to pyproject toml (#372)
1 parent d4a718f commit 1178440

File tree

3 files changed

+68
-79
lines changed

3 files changed

+68
-79
lines changed

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Change log
44
2.2 (unreleased)
55
----------------
66

7+
- Move package metadata from setup.py to pyproject.toml.
8+
79
- When moving metadata to ``pyproject.toml``, ignore ``setup py test`` fossils.
810
(`#260 <https://github.com/zopefoundation/meta/issues/260>`_)
911

pyproject.toml

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,71 @@
11
# Generated with zope.meta (https://zopemeta.readthedocs.io/) from:
22
# https://github.com/zopefoundation/meta/tree/master/src/zope/meta/pure-python
3-
43
[build-system]
54
requires = [
65
"setuptools >= 78.1.1,< 81",
76
"wheel",
87
]
98
build-backend = "setuptools.build_meta"
109

10+
11+
[project]
12+
name = "zope.meta"
13+
version = "2.2.dev0"
14+
description = "Helper functions for package management"
15+
license = "ZPL-2.1"
16+
classifiers = [
17+
"Development Status :: 5 - Production/Stable",
18+
"Intended Audience :: Developers",
19+
"Programming Language :: Python",
20+
"Programming Language :: Python :: 3",
21+
"Programming Language :: Python :: 3.10",
22+
"Programming Language :: Python :: 3.11",
23+
"Programming Language :: Python :: 3.12",
24+
"Programming Language :: Python :: 3.13",
25+
"Programming Language :: Python :: 3.14",
26+
"Natural Language :: English",
27+
"Operating System :: OS Independent",
28+
]
29+
requires-python = ">=3.10"
30+
authors = [
31+
{name = "Zope Foundation and contributors",email = "[email protected]"},
32+
]
33+
maintainers = [
34+
{name = "Plone Foundation and contributors",email = "[email protected]"},
35+
]
36+
dependencies = [
37+
"check-python-versions",
38+
"Jinja2",
39+
"packaging",
40+
"pyupgrade",
41+
"requests",
42+
"tomlkit",
43+
"tox",
44+
"zest.releaser",
45+
]
46+
keywords = ["zope", "packaging"]
47+
48+
[project.scripts]
49+
config-package = "zope.meta.config_package:main"
50+
multi-call = "zope.meta.multi_call:main"
51+
re-enable-actions = "zope.meta.re_enable_actions:main"
52+
set-branch-protection-rules = "zope.meta.set_branch_protection_rules:main"
53+
setup-to-pyproject = "zope.meta.setup_to_pyproject:main"
54+
update-python-support = "zope.meta.update_python_support:main"
55+
switch-to-pep420 = "zope.meta.pep_420:main"
56+
57+
[project.optional-dependencies]
58+
test = ["zope.testrunner >= 6.4"]
59+
docs = [
60+
"Sphinx",
61+
"furo",
62+
]
63+
64+
[project.urls]
65+
Documentation = "https://zopemeta.readthedocs.io"
66+
Source = "https://github.com/zopefoundation/meta"
67+
Issues = "https://github.com/zopefoundation/meta/issues"
68+
1169
[tool.coverage.run]
1270
branch = true
1371
source = ["zope.meta"]
@@ -30,3 +88,6 @@ exclude_lines = [
3088

3189
[tool.coverage.html]
3290
directory = "parts/htmlcov"
91+
92+
[tool.setuptools.dynamic]
93+
readme = {file = ["README.rst", "CHANGES.rst"]}

setup.py

Lines changed: 4 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
##############################################################################
22
#
3-
# Copyright (c) 2024 Zope Foundation and Contributors.
3+
# Copyright (c) 2024-2025 Zope Foundation and Contributors.
44
# All Rights Reserved.
55
#
66
# This software is subject to the provisions of the Zope Public License,
@@ -11,84 +11,10 @@
1111
# FOR A PARTICULAR PURPOSE.
1212
#
1313
##############################################################################
14-
"""Setup for zope.meta package
15-
"""
16-
17-
import os
14+
"""Setup for zope.meta package"""
1815

1916
from setuptools import setup
2017

2118

22-
def read(*rnames):
23-
with open(os.path.join(os.path.dirname(__file__), *rnames)) as stream:
24-
return stream.read()
25-
26-
27-
setup(
28-
name='zope.meta',
29-
version='2.2.dev0',
30-
author='Zope Foundation and Contributors',
31-
author_email='[email protected]',
32-
description='Helper functions for package management',
33-
long_description=(
34-
read('README.rst')
35-
+ '\n\n' +
36-
read('CHANGES.rst')
37-
),
38-
long_description_content_type='text/x-rst',
39-
keywords="zope packaging",
40-
classifiers=[
41-
'Development Status :: 3 - Alpha',
42-
'Intended Audience :: Developers',
43-
'License :: OSI Approved :: Zope Public License',
44-
'Programming Language :: Python',
45-
'Programming Language :: Python :: 3',
46-
'Programming Language :: Python :: 3.10',
47-
'Programming Language :: Python :: 3.11',
48-
'Programming Language :: Python :: 3.12',
49-
'Programming Language :: Python :: 3.13',
50-
'Programming Language :: Python :: 3.14',
51-
'Programming Language :: Python :: Implementation :: CPython',
52-
'Natural Language :: English',
53-
'Operating System :: OS Independent',
54-
],
55-
license='ZPL-2.1',
56-
url='https://github.com/zopefoundation/meta',
57-
project_urls={
58-
'Documentation': 'https://zopemeta.readthedocs.io',
59-
'Issue Tracker': 'https://github.com/zopefoundation/meta/issues',
60-
'Sources': 'https://github.com/zopefoundation/meta',
61-
},
62-
install_requires=[
63-
'setuptools',
64-
'check-python-versions',
65-
'Jinja2',
66-
'packaging',
67-
'pyupgrade',
68-
'requests',
69-
'tomlkit',
70-
'tox',
71-
'zest.releaser',
72-
],
73-
python_requires='>=3.10',
74-
include_package_data=True,
75-
zip_safe=False,
76-
extras_require={
77-
'test': ['zope.testrunner >= 6.4'],
78-
'docs': ['Sphinx', 'furo'],
79-
},
80-
entry_points={
81-
'console_scripts': [
82-
'config-package=zope.meta.config_package:main',
83-
'multi-call=zope.meta.multi_call:main',
84-
're-enable-actions=zope.meta.re_enable_actions:main',
85-
(
86-
'set-branch-protection-rules='
87-
'zope.meta.set_branch_protection_rules:main'
88-
),
89-
'setup-to-pyproject=zope.meta.setup_to_pyproject:main',
90-
'update-python-support=zope.meta.update_python_support:main',
91-
'switch-to-pep420=zope.meta.pep_420:main',
92-
],
93-
},
94-
)
19+
# See pyproject.toml for package metadata
20+
setup()

0 commit comments

Comments
 (0)