-
-
Notifications
You must be signed in to change notification settings - Fork 38
/
pyproject.toml
197 lines (161 loc) · 5.5 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
[build-system]
requires = ["hatchling", "hatch-vcs", "hatch-fancy-pypi-readme"]
build-backend = "hatchling.build"
[project]
name = "service-identity"
authors = [{ name = "Hynek Schlawack", email = "[email protected]" }]
license = "MIT"
requires-python = ">=3.8"
description = "Service identity verification for pyOpenSSL & cryptography."
keywords = ["cryptography", "openssl", "pyopenssl"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Security :: Cryptography",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
dependencies = [
# Keep in-sync with tests/constraints/*.
"attrs>=19.1.0",
"pyasn1-modules",
"pyasn1",
"cryptography",
]
dynamic = ["version", "readme"]
[project.optional-dependencies]
idna = ["idna"]
tests = ["coverage[toml]>=5.0.2", "pytest"]
docs = ["sphinx", "furo", "myst-parser", "sphinx-notfound-page", "pyOpenSSL"]
mypy = ["mypy", "types-pyOpenSSL", "idna"]
dev = ["service-identity[tests,mypy,idna]", "pyOpenSSL"]
[project.urls]
Documentation = "https://service-identity.readthedocs.io/"
Changelog = "https://service-identity.readthedocs.io/en/stable/changelog.html"
GitHub = "https://github.com/pyca/service-identity"
Funding = "https://github.com/sponsors/hynek"
Tidelift = "https://tidelift.com/subscription/pkg/pypi-service-identity?utm_source=pypi-service-identity&utm_medium=pypi"
Mastodon = "https://mastodon.social/@hynek"
Twitter = "https://twitter.com/hynek"
[tool.hatch.version]
source = "vcs"
raw-options = { local_scheme = "no-local-version" }
[tool.hatch.metadata.hooks.fancy-pypi-readme]
content-type = "text/markdown"
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
text = "# Service Identity Verification for pyOpenSSL & *cryptography*\n"
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
path = "README.md"
start-after = "spiel-begin -->\n"
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
text = """
## Release Information
"""
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
path = "CHANGELOG.md"
pattern = "\n(###.+?\n)## "
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
text = """
----
[Complete Changelog →](https://service-identity.readthedocs.io/en/stable/changelog.html)
"""
[tool.pytest.ini_options]
addopts = ["-ra", "--strict-markers", "--strict-config"]
xfail_strict = true
testpaths = "tests"
filterwarnings = ["once::Warning"]
norecursedirs = ["tests/typing"]
[tool.coverage.run]
parallel = true
branch = true
source = ["service_identity"]
[tool.coverage.paths]
source = ["src", ".tox/py*/**/site-packages"]
[tool.coverage.report]
show_missing = true
skip_covered = true
exclude_lines = [
# a more strict default pragma
"\\# pragma: no cover\\b",
# allow defensive code
"^\\s*raise AssertionError\\b",
"^\\s*raise NotImplementedError\\b",
"^\\s*return NotImplemented\\b",
"^\\s*raise$",
# typing-related code
"^if (False|TYPE_CHECKING):",
": \\.\\.\\.(\\s*#.*)?$",
"^ +\\.\\.\\.$",
"-> ['\"]?NoReturn['\"]?:",
]
[tool.interrogate]
omit-covered-files = true
verbose = 2
fail-under = 100
whitelist-regex = ["test_.*"]
[tool.ruff]
src = ["src", "tests"]
line-length = 79
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"A001", # shadowing is fine
"ANN", # Mypy is better at this
"ARG001", # we don't control all args passed in
"ARG005", # we need stub lambdas
"COM", # ruff format takes care of our commas
"D", # We prefer our own docstring style.
"E501", # leave line-length enforcement to ruff format
"FIX", # Yes, we want XXX as a marker.
"INP001", # sometimes we want Python files outside of packages
"ISC001", # conflicts with ruff format
"N801", # some artistic freedom when naming things after RFCs
"N802", # ditto
"PLR2004", # numbers are sometimes fine
"RUF001", # leave my smart characters alone
"SLF001", # private members are accessed by friendly functions
"TCH", # TYPE_CHECKING blocks break autodocs
"TD", # we don't follow other people's todo style
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = [
"B018", # "useless" expressions can be useful in tests
"PLC1901", # empty strings are falsey, but are less specific in tests
"PT005", # we always add underscores and explicit name
"PT011", # broad is fine
"S101", # assert
"S301", # I know pickle is bad, but people use it.
"SIM300", # Yoda rocks in asserts
"TRY301", # tests need to raise exceptions
]
"docs/pyopenssl_example.py" = [
"T201", # print is fine in the example
"T203", # pprint is fine in the example
]
[tool.ruff.lint.isort]
lines-between-types = 1
lines-after-imports = 2
[tool.mypy]
strict = true
pretty = true
show_error_codes = true
enable_error_code = ["ignore-without-code"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "tests.*"
ignore_errors = true
[[tool.mypy.overrides]]
module = "tests.typing.*"
ignore_errors = false
[[tool.mypy.overrides]]
module = "cryptography.*"
follow_imports = "skip"