forked from litl/backoff
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
262 lines (240 loc) · 6.24 KB
/
Copy pathpyproject.toml
File metadata and controls
262 lines (240 loc) · 6.24 KB
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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
[project]
name = "python-backoff"
version = "2.4.0"
description = "Function decoration for backoff and retry"
authors = [{ name = "Bob Green", email = "rgreen@aquent.com" }]
maintainers = [{ name = "Edgar Ramírez-Mondragón", email = "edgarrm358@gmail.com" }]
requires-python = ">=3.9"
readme = "README.rst"
license = "MIT"
keywords = [
"retry",
"backoff",
"decorators",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"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 :: 3.14",
"Programming Language :: Python :: 3.15",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
]
[project.urls]
Documentation = "https://python-backoff.github.io/backoff"
Repository = "https://github.com/python-backoff/backoff"
[dependency-groups]
dev = [
{ include-group = "docs" },
{ include-group = "lint" },
{ include-group = "test" },
{ include-group = "typing" },
]
docs = [
"mkdocstrings[python]~=1.0.2",
"zensical==0.0.53",
]
lint = [
"ruff>=0.16.0",
]
test = [
"coverage>=7.2.7",
"dirty-equals>=0.11",
"importlib-metadata>=8.5.0",
"packaging>=25.0",
"pytest>=7.1.2",
"pytest-asyncio>=0.18.3",
"requests>=2.26.0",
"responses>=0.20.0",
"tomli>=2.3.0",
]
typing = [
{ include-group = "test" },
"mypy>=0.942",
"pyrefly>=1.1.1",
"ty>=0.0.59",
"typing-extensions>=4.1; python_version < '3.10'"
]
[tool.hatch.build.targets.sdist]
include = ["backoff", "tests"]
[tool.hatch.build.targets.wheel]
include = ["backoff"]
[tool.tox]
requires = [ "tox>=4.53", "tox-uv" ]
env_list = [
"format",
{ product = [
{ prefix = "3.", start = 9 },
] },
"coverage",
"lint",
"typing",
"docs",
]
[tool.tox.env_run_base]
description = "run unit tests on Python {py_dot_ver}"
dependency_groups = [ "test" ]
uv_python_preference = "managed"
commands = [
[ "coverage", "run", "-m", "pytest", { replace = "posargs", default = [ "tests" ], extend = true } ],
]
[tool.tox.env.coverage]
description = "generate coverage report"
depends = ["3.*"]
dependency_groups = [ "test" ]
commands = [
[ "coverage", "combine" ],
[ "coverage", "report" ],
[ "coverage", "xml" ],
]
[tool.tox.env.format]
description = "format code"
dependency_groups = [ "lint" ]
commands = [
[ "ruff", "check", "--fix", { replace = "posargs", default = [ "backoff", "tests", "docs" ], extend = true } ],
[ "ruff", "format", { replace = "posargs", default = [ "backoff", "tests", "docs" ], extend = true } ],
]
[tool.tox.env.lint]
description = "lint code"
dependency_groups = [ "lint" ]
labels = [ "check" ]
commands = [
[
"ruff",
"check",
{ replace = "if", condition = "env.GITHUB_ACTIONS == 'true'", then = ["--output-format=github"], extend = true },
{ replace = "posargs", default = [ "backoff", "tests", "docs" ], extend = true },
],
[
"ruff",
"format",
"--check",
{ replace = "if", condition = "env.GITHUB_ACTIONS == 'true'", then = ["--output-format=github"], extend = true },
{ replace = "posargs", default = [ "backoff", "tests", "docs" ], extend = true },
],
]
[tool.tox.env.typing]
description = "run type checking"
dependency_groups = [ "typing" ]
labels = [ "check" ]
commands = [
[
"mypy",
"--show-error-codes",
{ replace = "posargs", default = [
"backoff",
"tests",
], extend = true },
],
[
"ty",
"check",
{ replace = "if", condition = "env.GITHUB_ACTIONS == 'true'", then = [ "--output-format=github" ], else = [], extend = true },
{ replace = "posargs", default = [
"backoff",
"tests",
], extend = true },
],
[
"pyrefly",
"check",
{ replace = "if", condition = "env.GITHUB_ACTIONS == 'true'", then = [ "--output-format=github" ], else = [], extend = true },
{ replace = "posargs", default = [
"backoff",
"tests",
], extend = true },
],
]
[tool.tox.env.docs]
description = "build the documentation"
deps = [ "-r ./requirements/docs.requirements.txt" ]
commands = [
[ "zensical", { replace = "posargs", default = [ "build", "--strict" ], extend = true } ],
]
[tool.pytest.ini_options]
filterwarnings = [
"error",
]
[tool.coverage.paths]
package = [
"backoff/",
"*/site-packages/backoff/",
]
[tool.ruff]
line-length = 88
preview = true
required-version = ">=0.16.0"
[tool.ruff.format]
docstring-code-format = true
docstring-code-line-length = 20
[tool.ruff.lint]
extend-select = [
"YTT", # flake8-2020
"ASYNC", # flake8-async
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"FA", # flake8-future-annotations
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"LOG", # flake8-logging
"G", # flake8-logging-format
"PIE", # flake8-pie
"T20", # flake8-print
"PT", # flake8-pytest-style
"RET", # flake8-return
"SIM", # flake8-simplify
"TC", # flake8-type-checking
"I", # isort
"PERF", # Perflint
"UP", # pyupgrade
"FURB", # refurb
"RUF", # Ruff-specific rules
]
ignore = [
# converting to a `yield from` expression is not safe because this library sends values via `send`
# https://docs.astral.sh/ruff/rules/yield-in-for-loop/#fix-safety
"yield-in-for-loop",
]
[tool.mypy]
check_untyped_defs = true
follow_untyped_imports = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
[tool.ruff.lint.per-file-ignores]
"**/doccmd_*.py" = [
"redefined-while-unused",
"undefined-name",
"print",
"unused-async",
]
"tests/**.py" = [
"assert",
"unused-async",
]
[tool.coverage.report]
fail_under = 100
show_missing = true
[tool.coverage.run]
branch = true
parallel = true
relative_files = true
source = [
"backoff",
]
[tool.pyrefly]
preset = "legacy"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"