-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
223 lines (198 loc) · 6.58 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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# SPDX-FileCopyrightText: 2023 Gert van Dijk <[email protected]>
#
# SPDX-License-Identifier: CC0-1.0
[build-system]
requires = [
"setuptools>=61.0.0", # For reading all configuration from pyproject.toml
"setuptools-scm[toml]>=6.2",
]
build-backend = "setuptools.build_meta"
[project]
name = "purepythonmilter"
authors = [
{ name = "Gert van Dijk", email = "[email protected]" },
]
description = "A Milter library and app framework in pure-Python with asyncio"
license = { text = "Apache License 2.0" }
dynamic = ["version", "readme"]
requires-python = ">=3.10"
classifiers = [
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Topic :: Communications :: Email",
"Topic :: Communications :: Email :: Filters",
"Topic :: Communications :: Email :: Mail Transport Agents",
"Topic :: Software Development :: Libraries",
"Typing :: Typed",
]
dependencies = [
"attrs",
]
[project.optional-dependencies]
development = [
"black>=23.9.1",
"build",
"check-wheel-contents",
"mypy>=1.6.0",
"pytest-asyncio",
"pytest-cov",
"pytest",
"reuse",
"ruff>=0.0.292",
"setuptools-scm[toml]>=6.2",
"twine",
"validate-pyproject[all]",
]
examples = [
# 8.1.4 has typing issues with mypy
# https://github.com/pallets/click/issues/2558
"click!=8.1.4",
]
[project.urls]
homepage = "https://github.com/gertvdijk/purepythonmilter"
repository = "https://github.com/gertvdijk/purepythonmilter.git"
[tool.setuptools]
license-files = ["LICENSES/*.txt"]
include-package-data = false
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools.dynamic]
readme = { file = ["README.md"], content-type = "text/markdown" }
[tool.setuptools_scm]
version_scheme = "guess-next-dev"
[tool.ruff]
src = ["src", "tests"]
target-version = "py310"
select = [
"F", # Pyflakes
"E", # pycodestyle errors
"W", # pycodestyle warnings
"C90", # mccabe
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"YTT", # flake8-2020
"ANN", # flake8-annotations
"ASYNC", # flake8-async
"S", # flake8-bandit
"BLE", # flake8-blind-except
"FBT", # flake8-boolean-trap
"B", # flake8-bugbear
"A", # flake8-builtins
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"T10", # flake8-debugger
"DJ", # flake8-django
"EXE", # flake8-executable
"FA", # flake8-future-annotations
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"INP", # flake8-no-pep420
"PIE", # flake8-pie
"T20", # flake8-print
"PYI", # flake8-pyi
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RSE", # flake8-raise
"RET", # flake8-return
"SLF", # flake8-self
"SLOT", # flake8-slots
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
"TCH", # flake8-type-checking
"INT", # flake8-gettext
"PTH", # flake8-use-pathlib
"TD", # flake8-todos
"FIX", # flake8-fixme
"PD", # pandas-vet
"PGH", # pygrep-hooks
"PL", # Pylint
"TRY", # tryceratops
"FLY", # flynt
"NPY", # NumPy-specific rules
"AIR", # Airflow
"PERF", # Perflint
"RUF", # Ruff-specific rules
# Generally good suggestions, but disabled, because too invasive or too much effort
# for now to fix.
# "D", # pydocstyle
# "EM", # flake8-errmsg
# "G", # flake8-logging-format
# Disabled, because it also enforces commas on single-item function calls broken
# over multiple lines (non-configurable).
# "COM", # flake8-commas
# Disabled, because unused arguments are sometimes purposefully unused but included
# for brevity or API requirements as reason (e.g. the callable is passed).
# "ARG", # flake8-unused-arguments
# Disabled for having plain erroneous auto-fixes removing actual comments as
# 'dead code'. 😕
# "ERA", # eradicate
# Copyright notices are enforced using reuse.
# "CPY", # Copyright-related rules
]
ignore = [
# "Avoid specifying long messages outside the exception class"
# https://github.com/guilatrova/tryceratops/blob/main/docs/violations/TC003.md
# "Abstract `raise` to an inner function"
# https://github.com/guilatrova/tryceratops/blob/main/docs/violations/TC301.md
# Good suggestions, but too invasive for now to fix.
"TRY003",
"TRY301",
# "Missing type annotation for `self` in method"
# https://github.com/charliermarsh/ruff/blob/main/docs/rules/missing-type-self.md
# "Missing type annotation for `cls` in classmethod"
# https://github.com/charliermarsh/ruff/blob/main/docs/rules/missing-type-cls.md
# ... seem absolutely ridiculous. 🤨
"ANN101",
"ANN102",
# "Use of assert detected" https://stackoverflow.com/a/68429294/1254292
"S101",
# "Missing author in TODO; try: `# TODO(<author_name>): ...`"
"TD002",
# "Missing issue link on the line following this TODO"
"TD003",
# "Line contains TODO"
"FIX002",
# "`try`-`except` within a loop incurs performance overhead"
# Quite a few of them in current code base; hard to refactor.
"PERF203",
]
[tool.ruff.per-file-ignores]
"tests/**" = [
# "SLF001 Private member accessed" is OK in tests.
"SLF001",
# "Relative imports from parent modules are banned"
# https://github.com/adamchainz/flake8-tidy-imports#ban-relative-imports
# is OK in tests or else it looks like 'tests' is an actual package...
"TID252",
# "Using the global statement to update [...] is discouraged" is OK in tests.
"PLW0603",
]
[tool.ruff.isort]
required-imports = [
# PEP-563 (new semantics for annotations) is gated behind
# 'from __future__ import annotations', including Python 3.10 & 3.11.
# https://docs.python.org/3/library/__future__.html#id1
"from __future__ import annotations",
]
[tool.mypy]
strict = true
namespace_packages = true
show_error_codes = true
show_column_numbers = true
show_error_context = true
[tool.pytest.ini_options]
# Already move to future-default asyncio strict mode.
# https://github.com/pytest-dev/pytest-asyncio#modes
asyncio_mode = "strict"
addopts = [
"--capture=no", # Do not capture stdout, may hide output in some cases
"--durations=5", # Get attention to slow tests
"--cov=purepythonmilter",
"--cov-report=term-missing",
"--cov-report=xml:.pytest-cov/coverage.xml",
"--cov-report=html:.pytest-cov/html/",
]
log_level = "DEBUG"