Skip to content

Commit 73cdd0c

Browse files
committed
Move most of setuptools attributes to pyproject.toml
- ensures that the license metadata is correctly created - also moved setup.cfg content into pyproject.toml
1 parent dc04a9f commit 73cdd0c

File tree

5 files changed

+68
-73
lines changed

5 files changed

+68
-73
lines changed

.pylintrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ disable=wrong-import-position,
166166
enable=consider-using-augmented-assign
167167

168168
[FORMAT]
169-
# duplicated from setup.cfg
170169
max-line-length=160
171170
max-module-lines=1100
172171

CHANGES.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
3.3.1 (unreleased)
66
==================
77

8-
- Nothing changed yet.
8+
- Make sure that the `License-Expression` attribute is correctly set
9+
in the metadata.
910

1011

1112
3.3.0 (2025-12-04)

pyproject.toml

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,70 @@
11
[build-system]
22
build-backend = "setuptools.build_meta"
33
requires = [
4-
"setuptools >= 40.8.0"
4+
"setuptools >= 77.0.3"
55
]
6+
7+
[project]
8+
name = "greenlet"
9+
description = "Lightweight in-process concurrent programming"
10+
readme = "README.rst"
11+
authors = [
12+
{ name = "Alexey Borzenkov", email = "snaury@gmail.com" },
13+
]
14+
maintainers = [
15+
{ name = "Jason Madden", email = "jason@seecoresoftware.com" }
16+
]
17+
license = "MIT AND Python-2.0"
18+
license-files = [
19+
'LICENSE',
20+
'LICENSE.PSF',
21+
]
22+
classifiers = [
23+
"Development Status :: 5 - Production/Stable",
24+
"Intended Audience :: Developers",
25+
"Natural Language :: English",
26+
"Programming Language :: C",
27+
"Programming Language :: Python",
28+
"Programming Language :: Python :: 3",
29+
"Programming Language :: Python :: 3.10",
30+
"Programming Language :: Python :: 3.11",
31+
"Programming Language :: Python :: 3.12",
32+
"Programming Language :: Python :: 3.13",
33+
"Programming Language :: Python :: 3.14",
34+
"Operating System :: OS Independent",
35+
"Topic :: Software Development :: Libraries :: Python Modules",
36+
]
37+
keywords = [
38+
"greenlet",
39+
"coroutine",
40+
"concurrency",
41+
"threads",
42+
"cooperative",
43+
]
44+
requires-python = ">=3.10"
45+
dynamic = ["version"]
46+
47+
[project.urls]
48+
Homepage = "https://greenlet.readthedocs.io"
49+
Documentation = "https://greenlet.readthedocs.io"
50+
Repository = "https://github.com/python-greenlet/greenlet"
51+
Issues = "https://github.com/python-greenlet/greenlet/issues"
52+
Changelog = "https://greenlet.readthedocs.io/en/latest/changes.html"
53+
54+
[project.optional-dependencies]
55+
docs = [
56+
"Sphinx",
57+
"furo",
58+
]
59+
test = [
60+
"objgraph",
61+
"psutil",
62+
"setuptools",
63+
]
64+
65+
[tool.setuptools.dynamic]
66+
version = {attr = "greenlet.__version__"}
67+
68+
[tools.zest-releaser]
69+
python-file-with-version = "src/greenlet/__init__.py"
70+
create-wheel = false

setup.cfg

Lines changed: 0 additions & 3 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,6 @@
114114
# this:
115115
cpp_compile_args.append('/std:c++20')
116116

117-
def readfile(filename):
118-
with open(filename, 'r') as f: # pylint:disable=unspecified-encoding
119-
return f.read()
120-
121117
GREENLET_SRC_DIR = 'src/greenlet/'
122118
GREENLET_HEADER_DIR = GREENLET_SRC_DIR
123119
GREENLET_HEADER = GREENLET_HEADER_DIR + 'greenlet.h'
@@ -197,72 +193,9 @@ def _find_impl_headers():
197193
]
198194

199195

200-
def get_greenlet_version():
201-
with open('src/greenlet/__init__.py') as f: # pylint:disable=unspecified-encoding
202-
looking_for = '__version__ = \''
203-
for line in f:
204-
if line.startswith(looking_for):
205-
version = line[len(looking_for):-2]
206-
return version
207-
raise ValueError("Unable to find version")
208-
209-
210196
setup(
211-
name="greenlet",
212-
version=get_greenlet_version(),
213-
description='Lightweight in-process concurrent programming',
214-
long_description=readfile("README.rst"),
215-
long_description_content_type="text/x-rst",
216-
url="https://greenlet.readthedocs.io/",
217-
keywords="greenlet coroutine concurrency threads cooperative",
218-
author="Alexey Borzenkov",
219-
author_email="snaury@gmail.com",
220-
maintainer='Jason Madden',
221-
maintainer_email='jason@seecoresoftware.com',
222-
project_urls={
223-
'Bug Tracker': 'https://github.com/python-greenlet/greenlet/issues',
224-
'Source Code': 'https://github.com/python-greenlet/greenlet/',
225-
'Documentation': 'https://greenlet.readthedocs.io/',
226-
'Changes': 'https://greenlet.readthedocs.io/en/latest/changes.html',
227-
},
228-
license="MIT AND Python-2.0",
229-
license_files=[
230-
'LICENSE',
231-
'LICENSE.PSF',
232-
],
233-
platforms=['any'],
234197
package_dir={'': 'src'},
235198
packages=find_packages('src'),
236-
include_package_data=True,
237199
headers=headers,
238200
ext_modules=ext_modules,
239-
classifiers=[
240-
"Development Status :: 5 - Production/Stable",
241-
'Intended Audience :: Developers',
242-
'Natural Language :: English',
243-
'Programming Language :: C',
244-
'Programming Language :: Python',
245-
'Programming Language :: Python :: 3',
246-
'Programming Language :: Python :: 3 :: Only',
247-
'Programming Language :: Python :: 3.10',
248-
'Programming Language :: Python :: 3.11',
249-
'Programming Language :: Python :: 3.12',
250-
'Programming Language :: Python :: 3.13',
251-
'Programming Language :: Python :: 3.14',
252-
'Operating System :: OS Independent',
253-
'Topic :: Software Development :: Libraries :: Python Modules'
254-
],
255-
extras_require={
256-
'docs': [
257-
'Sphinx',
258-
'furo',
259-
],
260-
'test': [
261-
'objgraph',
262-
'psutil',
263-
'setuptools',
264-
],
265-
},
266-
python_requires=">=3.10",
267-
zip_safe=False,
268201
)

0 commit comments

Comments
 (0)