Skip to content

Commit 724b1a3

Browse files
committed
Migrate from setup.cfg to pyproject.toml completely
One less file?
1 parent 550355b commit 724b1a3

File tree

4 files changed

+108
-28
lines changed

4 files changed

+108
-28
lines changed

.github/workflows/wheel-builder.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ on:
1414
paths:
1515
- .github/workflows/wheel-builder.yml
1616
- setup.py
17-
- setup.cfg
1817
- pyproject.toml
1918
- src/cryptography/__about__.py
2019

ci-constraints-requirements.txt

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This is named ambigiously, but it's a pip constraints file, named like a
22
# requirements file so dependabot will update the pins.
33
# It was originally generated with;
4-
# pip-compile --extra=docs --extra=docstest --extra=pep8test --extra=test --extra=test-randomorder --extra=tox --resolver=backtracking --strip-extras --unsafe-package=cffi --unsafe-package=pycparser --unsafe-package=setuptools setup.cfg
4+
# pip-compile --extra=docs --extra=docstest --extra=pep8test --extra=test --extra=test-randomorder --extra=tox --resolver=backtracking --strip-extras --unsafe-package=cffi --unsafe-package=pycparser --unsafe-package=setuptools pyproject.toml
55
# and then manually massaged to add version specifiers to packages whose
66
# versions vary by Python version
77

@@ -14,7 +14,7 @@ attrs==22.2.0
1414
babel==2.12.1
1515
# via sphinx
1616
black==23.1.0
17-
# via cryptography (setup.cfg)
17+
# via cryptography (pyproject.toml)
1818
bleach==6.0.0
1919
# via readme-renderer
2020
build==0.10.0
@@ -28,7 +28,7 @@ chardet==5.1.0
2828
charset-normalizer==3.0.1; python_version >= "3.7"
2929
# via requests
3030
check-manifest==0.49
31-
# via cryptography (setup.cfg)
31+
# via cryptography (pyproject.toml)
3232
click==8.1.3
3333
# via black
3434
colorama==0.4.6; python_version >= "3.7"
@@ -53,7 +53,7 @@ filelock==3.9.0; python_version >= "3.7"
5353
# tox
5454
# virtualenv
5555
hypothesis==6.68.2; python_version >= "3.7"
56-
# via cryptography (setup.cfg)
56+
# via cryptography (pyproject.toml)
5757
idna==3.4
5858
# via requests
5959
imagesize==1.4.1
@@ -65,7 +65,7 @@ importlib-metadata==6.0.0; python_version >= "3.7"
6565
iniconfig==2.0.0; python_version >= "3.7"
6666
# via pytest
6767
iso8601==1.1.0
68-
# via cryptography (setup.cfg)
68+
# via cryptography (pyproject.toml)
6969
jaraco-classes==3.2.3
7070
# via keyring
7171
jinja2==3.1.2
@@ -81,7 +81,7 @@ mdurl==0.1.2
8181
more-itertools==9.1.0
8282
# via jaraco-classes
8383
mypy==1.0.1
84-
# via cryptography (setup.cfg)
84+
# via cryptography (pyproject.toml)
8585
mypy-extensions==1.0.0
8686
# via
8787
# black
@@ -108,12 +108,12 @@ pluggy==1.0.0; python_version >= "3.7"
108108
# pytest
109109
# tox
110110
pretend==1.0.9
111-
# via cryptography (setup.cfg)
111+
# via cryptography (pyproject.toml)
112112
py-cpuinfo==9.0.0
113113
# via pytest-benchmark
114114
pyenchant==3.2.2
115115
# via
116-
# cryptography (setup.cfg)
116+
# cryptography (pyproject.toml)
117117
# sphinxcontrib-spelling
118118
pygments==2.14.0
119119
# via
@@ -126,25 +126,25 @@ pyproject-hooks==1.0.0
126126
# via build
127127
pytest==7.2.2; python_version >= "3.7"
128128
# via
129-
# cryptography (setup.cfg)
129+
# cryptography (pyproject.toml)
130130
# pytest-benchmark
131131
# pytest-cov
132132
# pytest-randomly
133133
# pytest-shard
134134
# pytest-subtests
135135
# pytest-xdist
136136
pytest-benchmark==4.0.0; python_version >= "3.7"
137-
# via cryptography (setup.cfg)
137+
# via cryptography (pyproject.toml)
138138
pytest-cov==4.0.0
139-
# via cryptography (setup.cfg)
139+
# via cryptography (pyproject.toml)
140140
pytest-randomly==3.12.0
141-
# via cryptography (setup.cfg)
141+
# via cryptography (pyproject.toml)
142142
pytest-shard==0.1.2
143-
# via cryptography (setup.cfg)
143+
# via cryptography (pyproject.toml)
144144
pytest-subtests==0.10.0; python_version >= "3.7"
145-
# via cryptography (setup.cfg)
145+
# via cryptography (pyproject.toml)
146146
pytest-xdist==3.2.0; python_version >= "3.7"
147-
# via cryptography (setup.cfg)
147+
# via cryptography (pyproject.toml)
148148
pytz==2022.7.1
149149
# via
150150
# babel
@@ -162,7 +162,7 @@ rfc3986==2.0.0
162162
rich==13.3.1
163163
# via twine
164164
ruff==0.0.254
165-
# via cryptography (setup.cfg)
165+
# via cryptography (pyproject.toml)
166166
six==1.16.0
167167
# via bleach
168168
snowballstemmer==2.2.0
@@ -171,11 +171,11 @@ sortedcontainers==2.4.0
171171
# via hypothesis
172172
sphinx==6.1.3
173173
# via
174-
# cryptography (setup.cfg)
174+
# cryptography (pyproject.toml)
175175
# sphinx-rtd-theme
176176
# sphinxcontrib-spelling
177177
sphinx-rtd-theme==1.2.0
178-
# via cryptography (setup.cfg)
178+
# via cryptography (pyproject.toml)
179179
sphinxcontrib-applehelp==1.0.4
180180
# via sphinx
181181
sphinxcontrib-devhelp==1.0.2
@@ -191,7 +191,7 @@ sphinxcontrib-qthelp==1.0.3
191191
sphinxcontrib-serializinghtml==1.1.5
192192
# via sphinx
193193
sphinxcontrib-spelling==8.0.0
194-
# via cryptography (setup.cfg)
194+
# via cryptography (pyproject.toml)
195195
tomli==2.0.1; python_version >= "3.7"
196196
# via
197197
# black
@@ -204,11 +204,11 @@ tomli==2.0.1; python_version >= "3.7"
204204
# pytest
205205
# tox
206206
tox==4.4.6; python_version >= "3.7"
207-
# via cryptography (setup.cfg)
207+
# via cryptography (pyproject.toml)
208208
twine==4.0.2
209-
# via cryptography (setup.cfg)
209+
# via cryptography (pyproject.toml)
210210
types-requests==2.28.11.15
211-
# via cryptography (setup.cfg)
211+
# via cryptography (pyproject.toml)
212212
types-urllib3==1.26.25.8
213213
# via types-requests
214214
typing-extensions==4.5.0; python_version >= "3.7"

pyproject.toml

Lines changed: 85 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,96 @@
11
[build-system]
22
requires = [
3-
# The minimum setuptools version is specific to the PEP 517 backend,
4-
# and may be stricter than the version required in `setup.cfg`
5-
"setuptools>=40.6.0,!=60.9.0",
3+
# First version of setuptools to support pyproject.toml configuration
4+
"setuptools>=61.0.0",
65
"wheel",
7-
# Must be kept in sync with the `install_requirements` in `setup.cfg`
6+
# Must be kept in sync with `project.dependencies`
87
"cffi>=1.12; platform_python_implementation != 'PyPy'",
98
"setuptools-rust>=0.11.4",
109
]
1110
build-backend = "setuptools.build_meta"
1211

12+
[project]
13+
name = "cryptography"
14+
authors = [
15+
{name = "The Python Cryptographic Authority and individual contributors", email = "[email protected]"}
16+
]
17+
description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers."
18+
license = {text = "(Apache-2.0 OR BSD-3-Clause) AND PSF-2.0"}
19+
classifiers = [
20+
"Development Status :: 5 - Production/Stable",
21+
"Intended Audience :: Developers",
22+
"License :: OSI Approved :: Apache Software License",
23+
"License :: OSI Approved :: BSD License",
24+
"Natural Language :: English",
25+
"Operating System :: MacOS :: MacOS X",
26+
"Operating System :: POSIX",
27+
"Operating System :: POSIX :: BSD",
28+
"Operating System :: POSIX :: Linux",
29+
'Operating System :: Microsoft :: Windows',
30+
"Programming Language :: Python",
31+
"Programming Language :: Python :: 3",
32+
"Programming Language :: Python :: 3 :: Only",
33+
"Programming Language :: Python :: 3.6",
34+
"Programming Language :: Python :: 3.7",
35+
"Programming Language :: Python :: 3.8",
36+
"Programming Language :: Python :: 3.9",
37+
"Programming Language :: Python :: 3.10",
38+
"Programming Language :: Python :: 3.11",
39+
"Programming Language :: Python :: Implementation :: CPython",
40+
"Programming Language :: Python :: Implementation :: PyPy",
41+
"Topic :: Security :: Cryptography",
42+
]
43+
requires-python = ">=3.6"
44+
dependencies = [
45+
# Must be kept in sync with `build-system.requires`
46+
"cffi >=1.12",
47+
]
48+
dynamic = ["version", "readme"]
49+
50+
[project.urls]
51+
homepage = "https://github.com/pyca/cryptography"
52+
documentation = "https://cryptography.io/"
53+
source = "https://github.com/pyca/cryptography/"
54+
issues = "https://github.com/pyca/cryptography/issues"
55+
changelog = "https://cryptography.io/en/latest/changelog/"
56+
57+
[tool.setuptools]
58+
zip-safe = false
59+
package-dir = {"" = "src"}
60+
61+
[tool.setuptools.packages.find]
62+
where = ["src"]
63+
exclude = [
64+
"_cffi_src",
65+
"_cffi_src.*",
66+
]
67+
68+
[tool.setuptools.dynamic]
69+
version = {attr = "cryptography.__version__"}
70+
readme = {file = "README.rst", content-type = "text/x-rst"}
71+
72+
[project.optional-dependencies]
73+
ssh = ["bcrypt >=3.1.5"]
74+
75+
# All the following are used for our own testing.
76+
tox = ["tox"]
77+
test = [
78+
"pytest >=6.2.0",
79+
"pytest-shard >=0.1.2",
80+
"pytest-benchmark",
81+
"pytest-cov",
82+
"pytest-subtests >=0.10.0",
83+
"pytest-xdist",
84+
"pretend",
85+
"iso8601",
86+
"hypothesis >=1.11.4, !=3.79.2",
87+
]
88+
test-randomorder = ["pytest-randomly"]
89+
docs = ["sphinx >=5.3.0", "sphinx-rtd-theme >=1.1.1"]
90+
docstest = ["pyenchant >=1.6.11", "twine >=1.12.0", "sphinxcontrib-spelling >=4.0.1"]
91+
sdist = ["setuptools_rust >=0.11.4"]
92+
pep8test = ["black", "ruff", "mypy", "types-requests", "check-manifest"]
93+
1394
[tool.black]
1495
line-length = 79
1596
target-version = ["py36"]

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
sys.path.insert(0, src_dir)
4545

4646
try:
47-
# See setup.cfg for most of the config metadata.
47+
# See pyproject.toml for most of the config metadata.
4848
setup(
4949
cffi_modules=[
5050
"src/_cffi_src/build_openssl.py:ffi",

0 commit comments

Comments
 (0)