Skip to content

Commit c29475b

Browse files
committed
Convert setup.py and setup.cfg into a pyproject.toml
To make it work with the last setuptools version
1 parent 7d43bb1 commit c29475b

File tree

5 files changed

+145
-182
lines changed

5 files changed

+145
-182
lines changed

RELEASING.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ Prepare new release branch
1919

2020
- Create a new release branch, incrementing the version number.
2121

22-
- Align the release number with deformdemo (setup.py, README.rst, CHANGES.txt).
22+
- Align the release number with deformdemo (pyproject.toml, README.rst, CHANGES.txt).
2323

2424
- Do any necessary branch merges (e.g., main to branch, branch to main).
2525

2626
- On release branch:
2727

2828
git pull
2929

30-
- Make sure your Python has ``setuptools-git``, ``twine``, and ``wheel``
30+
- Make sure your Python has `twine``, and ``wheel``
3131
installed:
3232

33-
$VENV/bin/pip install setuptools-git twine wheel
33+
$VENV/bin/pip install twine wheel
3434

3535
- Do a platform test, run a check with black, ensure the PyPI long description
3636
renders, and run check-manifest with the following command.
@@ -52,7 +52,7 @@ Prepare new release branch
5252
branch, and previously released branch. Also in the previously released
5353
branch only, uncomment the sections to enable pylons_sphinx_latesturl.
5454

55-
- Change setup.py version to the release version number.
55+
- Change pyproject.toml version to the release version number.
5656

5757
- Build an sdist and a wheel:
5858

pyproject.toml

Lines changed: 132 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,135 @@
1-
[build-system]
2-
requires = ["setuptools", "wheel"]
1+
[project]
2+
name = "deform"
3+
version = "3.0.0.dev0"
4+
description = "Form library with advanced features like nested forms"
5+
readme = "README.rst"
6+
requires-python = ">=3.10"
7+
license = {text = "BSD-derived"}
8+
authors = [
9+
{name = "Chris McDonough, Agendaless Consulting", email = "pylons-discuss@googlegroups.com"},
10+
]
11+
maintainers = [
12+
{name = "Josip Delić", email = "delijati@gmx.net"},
13+
{name = "Stéphane Brunner", email = "stephane.brunner@gmail.com"},
14+
]
15+
keywords = ["web", "forms", "form", "generation", "schema", "validation", "pyramid"]
16+
classifiers = [
17+
"Intended Audience :: Developers",
18+
"License :: Repoze Public License",
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 :: Implementation :: CPython",
26+
"Programming Language :: Python :: Implementation :: PyPy",
27+
]
28+
dependencies = [
29+
"Chameleon>=2.5.1",
30+
"colander>=1.0",
31+
"iso8601",
32+
"peppercorn>=0.3",
33+
"translationstring>=1.0",
34+
"zope.deprecation",
35+
]
36+
37+
[project.optional-dependencies]
38+
lint = [
39+
"black",
40+
"check-manifest",
41+
"flake8",
42+
"flake8-bugbear",
43+
"flake8-builtins",
44+
"isort",
45+
"rstcheck",
46+
"readme_renderer",
47+
]
48+
testing = [
49+
"beautifulsoup4",
50+
"coverage",
51+
"flaky",
52+
"pyramid",
53+
"pytest",
54+
"pytest-cov",
55+
]
56+
functional = [
57+
"beautifulsoup4",
58+
"coverage",
59+
"flaky",
60+
"pyramid",
61+
"pytest",
62+
"pytest-cov",
63+
"pygments",
64+
"waitress",
65+
"lingua",
66+
"selenium>=4.0.0.b4,<4.10.0",
67+
]
68+
docs = [
69+
"Sphinx>=1.7.4",
70+
"repoze.sphinx.autointerface",
71+
"pylons_sphinx_latesturl",
72+
"pylons-sphinx-themes",
73+
]
74+
dev = [
75+
"black",
76+
"check-manifest",
77+
"flake8",
78+
"flake8-bugbear",
79+
"flake8-builtins",
80+
"isort",
81+
"rstcheck",
82+
"readme_renderer",
83+
"beautifulsoup4",
84+
"coverage",
85+
"flaky",
86+
"pyramid",
87+
"pytest",
88+
"pytest-cov",
89+
"pygments",
90+
"waitress",
91+
"lingua",
92+
"selenium>=4.0.0.b4,<4.10.0",
93+
"Sphinx>=1.7.4",
94+
"repoze.sphinx.autointerface",
95+
"pylons_sphinx_latesturl",
96+
"pylons-sphinx-themes",
97+
]
98+
99+
[project.urls]
100+
Homepage = "https://docs.pylonsproject.org/projects/deform/en/latest/"
101+
Documentation = "https://docs.pylonsproject.org/projects/deform/en/3.0-branch/"
102+
Changelog = "https://docs.pylonsproject.org/projects/deform/en/3.0-branch/changes.html"
103+
"Issue Tracker" = "https://github.com/Pylons/deform/issues"
104+
105+
[tool.pytest.ini_options]
106+
python_files = ["test_*.py"]
107+
testpaths = ["deform/tests"]
108+
addopts = "-W always"
109+
110+
[tool.check-manifest]
111+
ignore-bad-ideas = ["*.mo"]
112+
113+
[tool.babel.compile_catalog]
114+
directory = "deform/locale"
115+
domain = "deform"
116+
statistics = true
117+
118+
[tool.babel.extract_messages]
119+
add_comments = "TRANSLATORS:"
120+
output_file = "deform/locale/deform.pot"
121+
width = 80
122+
123+
[tool.babel.init_catalog]
124+
domain = "deform"
125+
input_file = "deform/locale/deform.pot"
126+
output_dir = "deform/locale"
127+
128+
[tool.babel.update_catalog]
129+
domain = "deform"
130+
input_file = "deform/locale/deform.pot"
131+
output_dir = "deform/locale"
132+
previous = true
3133

4134
[tool.black]
5135
line-length = 79

setup.cfg

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

setup.py

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

tox.ini

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@ commands =
2323
commands =
2424
python --version
2525
pip freeze
26-
flake8 deform setup.py
27-
isort --check-only --df deform setup.py
28-
black --check --diff deform setup.py
29-
# XXX -r reports now warnings too so we fail
30-
python setup.py check -s -m
31-
rstcheck README.rst CHANGES.txt
26+
flake8 deform
27+
isort --check-only --df deform
28+
black --check --diff deform
29+
rstcheck README.rst CHANGES.txt
3230
check-manifest
3331
extras =
3432
lint
@@ -70,8 +68,8 @@ deps =
7068
[testenv:format]
7169
skip_install = true
7270
commands =
73-
isort deform setup.py
74-
black deform setup.py
71+
isort deform
72+
black deform
7573
deps =
7674
black
7775
isort
@@ -82,11 +80,8 @@ skip_install = true
8280
commands =
8381
# clean up build/ and dist/ folders
8482
python -c 'import shutil; shutil.rmtree("dist", ignore_errors=True)'
85-
python setup.py clean --all
86-
# build sdist
87-
python setup.py sdist --dist-dir {toxinidir}/dist
88-
# build wheel from sdist
89-
pip wheel -v --no-deps --no-index --no-build-isolation --wheel-dir {toxinidir}/dist --find-links {toxinidir}/dist deform
83+
# build sdist and wheel
84+
python -m build --sdist --wheel --outdir {toxinidir}/dist
9085
deps =
91-
setuptools
86+
build
9287
wheel

0 commit comments

Comments
 (0)