Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7e19ff0

Browse files
authored
Migrate from setup.cfg to pyproject.toml completely (pyca#8116)
One less file?
1 parent baea427 commit 7e19ff0

File tree

5 files changed

+105
-116
lines changed

5 files changed

+105
-116
lines changed

.github/workflows/wheel-builder.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ on:
1616
paths:
1717
- .github/workflows/wheel-builder.yml
1818
- setup.py
19-
- setup.cfg
2019
- pyproject.toml
2120
- src/cryptography/__about__.py
2221

ci-constraints-requirements.txt

Lines changed: 22 additions & 24 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

@@ -10,10 +10,11 @@ alabaster==0.7.13
1010
attrs==22.2.0
1111
# via
1212
# pytest
13+
# pytest-subtests
1314
babel==2.12.1
1415
# via sphinx
1516
black==23.1.0
16-
# via cryptography (setup.cfg)
17+
# via cryptography (pyproject.toml)
1718
bleach==6.0.0
1819
# via readme-renderer
1920
build==0.10.0
@@ -27,7 +28,7 @@ chardet==5.1.0
2728
charset-normalizer==3.1.0
2829
# via requests
2930
check-manifest==0.49
30-
# via cryptography (setup.cfg)
31+
# via cryptography (pyproject.toml)
3132
click==8.1.3
3233
# via black
3334
colorama==0.4.6
@@ -42,8 +43,7 @@ docutils==0.18.1
4243
# sphinx
4344
# sphinx-rtd-theme
4445
exceptiongroup==1.1.1
45-
# via
46-
# pytest
46+
# via pytest
4747
execnet==1.9.0
4848
# via pytest-xdist
4949
filelock==3.10.3
@@ -75,7 +75,7 @@ mdurl==0.1.2
7575
more-itertools==9.1.0
7676
# via jaraco-classes
7777
mypy==1.1.1
78-
# via cryptography (setup.cfg)
78+
# via cryptography (pyproject.toml)
7979
mypy-extensions==1.0.0
8080
# via
8181
# black
@@ -102,12 +102,12 @@ pluggy==1.0.0
102102
# pytest
103103
# tox
104104
pretend==1.0.9
105-
# via cryptography (setup.cfg)
105+
# via cryptography (pyproject.toml)
106106
py-cpuinfo==9.0.0
107107
# via pytest-benchmark
108108
pyenchant==3.2.2
109109
# via
110-
# cryptography (setup.cfg)
110+
# cryptography (pyproject.toml)
111111
# sphinxcontrib-spelling
112112
pygments==2.14.0
113113
# via
@@ -120,28 +120,25 @@ pyproject-hooks==1.0.0
120120
# via build
121121
pytest==7.2.2
122122
# via
123-
# cryptography (setup.cfg)
123+
# cryptography (pyproject.toml)
124124
# pytest-benchmark
125125
# pytest-cov
126126
# pytest-randomly
127127
# pytest-shard
128128
# pytest-subtests
129129
# pytest-xdist
130130
pytest-benchmark==4.0.0
131-
# via cryptography (setup.cfg)
131+
# via cryptography (pyproject.toml)
132132
pytest-cov==4.0.0
133-
# via cryptography (setup.cfg)
133+
# via cryptography (pyproject.toml)
134134
pytest-randomly==3.12.0
135-
# via cryptography (setup.cfg)
135+
# via cryptography (pyproject.toml)
136136
pytest-shard==0.1.2
137-
# via cryptography (setup.cfg)
137+
# via cryptography (pyproject.toml)
138138
pytest-subtests==0.10.0
139-
# via cryptography (setup.cfg)
139+
# via cryptography (pyproject.toml)
140140
pytest-xdist==3.2.1
141-
# via cryptography (setup.cfg)
142-
pytz==2022.7.1
143-
# via
144-
# babel
141+
# via cryptography (pyproject.toml)
145142
readme-renderer==37.3
146143
# via twine
147144
requests==2.28.2
@@ -156,18 +153,19 @@ rfc3986==2.0.0
156153
rich==13.3.2
157154
# via twine
158155
ruff==0.0.259
159-
# via cryptography (setup.cfg)
156+
# via cryptography (pyproject.toml)
160157
six==1.16.0
161158
# via bleach
162159
snowballstemmer==2.2.0
163160
# via sphinx
164161
sphinx==6.1.3
165162
# via
166-
# cryptography (setup.cfg)
163+
# cryptography (pyproject.toml)
167164
# sphinx-rtd-theme
165+
# sphinxcontrib-jquery
168166
# sphinxcontrib-spelling
169167
sphinx-rtd-theme==1.2.0
170-
# via cryptography (setup.cfg)
168+
# via cryptography (pyproject.toml)
171169
sphinxcontrib-applehelp==1.0.4
172170
# via sphinx
173171
sphinxcontrib-devhelp==1.0.2
@@ -183,7 +181,7 @@ sphinxcontrib-qthelp==1.0.3
183181
sphinxcontrib-serializinghtml==1.1.5
184182
# via sphinx
185183
sphinxcontrib-spelling==8.0.0
186-
# via cryptography (setup.cfg)
184+
# via cryptography (pyproject.toml)
187185
tomli==2.0.1
188186
# via
189187
# black
@@ -196,9 +194,9 @@ tomli==2.0.1
196194
# pytest
197195
# tox
198196
tox==4.4.7
199-
# via cryptography (setup.cfg)
197+
# via cryptography (pyproject.toml)
200198
twine==4.0.2
201-
# via cryptography (setup.cfg)
199+
# via cryptography (pyproject.toml)
202200
typing-extensions==4.5.0
203201
# via mypy
204202
urllib3==1.26.15

pyproject.toml

Lines changed: 82 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,93 @@
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"}
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.7",
34+
"Programming Language :: Python :: 3.8",
35+
"Programming Language :: Python :: 3.9",
36+
"Programming Language :: Python :: 3.10",
37+
"Programming Language :: Python :: 3.11",
38+
"Programming Language :: Python :: Implementation :: CPython",
39+
"Programming Language :: Python :: Implementation :: PyPy",
40+
"Topic :: Security :: Cryptography",
41+
]
42+
requires-python = ">=3.7"
43+
dependencies = [
44+
# Must be kept in sync with `build-system.requires`
45+
"cffi >=1.12",
46+
]
47+
dynamic = ["version", "readme"]
48+
49+
[project.urls]
50+
homepage = "https://github.com/pyca/cryptography"
51+
documentation = "https://cryptography.io/"
52+
source = "https://github.com/pyca/cryptography/"
53+
issues = "https://github.com/pyca/cryptography/issues"
54+
changelog = "https://cryptography.io/en/latest/changelog/"
55+
56+
[tool.setuptools]
57+
zip-safe = false
58+
package-dir = {"" = "src"}
59+
60+
[tool.setuptools.packages.find]
61+
where = ["src"]
62+
exclude = [
63+
"_cffi_src",
64+
"_cffi_src.*",
65+
]
66+
67+
[tool.setuptools.dynamic]
68+
version = {attr = "cryptography.__version__"}
69+
readme = {file = "README.rst", content-type = "text/x-rst"}
70+
71+
[project.optional-dependencies]
72+
ssh = ["bcrypt >=3.1.5"]
73+
74+
# All the following are used for our own testing.
75+
tox = ["tox"]
76+
test = [
77+
"pytest >=6.2.0",
78+
"pytest-shard >=0.1.2",
79+
"pytest-benchmark",
80+
"pytest-cov",
81+
"pytest-subtests >=0.10.0",
82+
"pytest-xdist",
83+
"pretend",
84+
]
85+
test-randomorder = ["pytest-randomly"]
86+
docs = ["sphinx >=5.3.0", "sphinx-rtd-theme >=1.1.1"]
87+
docstest = ["pyenchant >=1.6.11", "twine >=1.12.0", "sphinxcontrib-spelling >=4.0.1"]
88+
sdist = ["setuptools_rust >=0.11.4"]
89+
pep8test = ["black", "ruff", "mypy", "check-manifest"]
90+
1391
[tool.black]
1492
line-length = 79
1593
target-version = ["py37"]

setup.cfg

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

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
rust_extensions=[
5050
RustExtension(

0 commit comments

Comments
 (0)