forked from starenka/mailjetv3
-
Notifications
You must be signed in to change notification settings - Fork 40
/
pyproject.toml
395 lines (349 loc) · 10.4 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
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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[tool.setuptools.packages.find]
include = ["mailjet_rest", "mailjet_rest.*", "tests", "test.py"]
[tool.setuptools.package-data]
mailjet_rest = ["py.typed", "*.pyi"]
[project]
name = "mailjet_rest"
version = "1.3.5"
description = "Mailjet V3 API wrapper"
authors = [
{ name = "starenka", email = "[email protected]" },
{ name = "Mailjet", email = "[email protected]" },
]
license = {text = "MIT"}
readme = "README.md"
requires-python = ">=3.9"
dependencies = ["requests>=2.32.3"]
keywords = [
"Mailjet API v3 / v3.1 Python Wrapper",
"wrapper",
"email python-wrapper",
"transactional-emails",
"mailjet",
"mailjet-api",
]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"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 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Communications :: Email",
"Topic :: Utilities",
]
[project.urls]
"Issue Tracker" = "https://github.com/mailjet/mailjet-apiv3-python"
"Repository" = "https://github.com/mailjet/mailjet-apiv3-python"
"Homepage" = "https://dev.mailjet.com"
"Documentation" = "https://dev.mailjet.com"
[project.optional-dependencies]
linting = [
# dev tools
"make",
"toml",
"autopep8",
"bandit",
"black>=21.7",
"autoflake",
"flake8>=3.7.8",
"pep8-naming",
"isort",
"yapf",
"pycodestyle",
"pydocstyle",
"pyupgrade",
"refurb",
"pre-commit",
"ruff",
"mypy",
"types-requests", # mypy requests stub
"pandas-stubs", # mypy pandas stub
"types-PyYAML",
"monkeytype", # It can generate type hints based on the observed behavior of your code.
"pyright",
"pylint",
"pyment>=0.3.3", # for generating docstrings
"pytype", # a static type checker for any type hints you have put in your code
"radon",
"vulture",
# env variables
"python-dotenv>=0.19.2",
]
metrics = [
"pystra", # provides functionalities to enable structural reliability analysis
"wily>=1.2.0", # a tool for reporting code complexity metrics
]
profilers = ["scalene>=1.3.16", "snakeviz"]
tests = [
# tests
"pytest>=7.0.0",
"pytest-benchmark",
"pytest-cov",
"coverage>=4.5.4",
"codecov",
]
conda_build = ["conda-build"]
spelling = ["typos"]
other = ["toml"]
[tool.black]
line-length = 88
target-version = ["py39", "py310", "py311", "py312"]
skip-string-normalization = false
skip-magic-trailing-comma = false
extend-exclude = '''
/(
| docs
| setup.py
| venv
)/
'''
[tool.autopep8]
max_line_length = 88
ignore = "" # or ["E501", "W6"]
in-place = true
recursive = true
aggressive = 3
[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
]
extend-exclude = ["tests", "test"]
# Same as Black.
line-length = 88
#indent-width = 4
# Assume Python 3.9.
target-version = "py39"
[tool.ruff.lint]
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default, ('UP') is pyupgrade.
# "ERA" - Found commented-out code
# see https://docs.astral.sh/ruff/rules/#rules
select = ["ALL"]
#select = ["A", "ARG", "B", "C4", "DTZ", "E", "EM", "ERA", "EXE", "F", "FA", "FLY", "FURB", "G", "ICN", "INP", "INT", "LOG", "N", "PD", "PERF", "PIE", "PLC", "PLE", "PLW", "PT", "PTH", "PYI", "Q", "RET", "RSE", "RUF", "S", "SIM", "T10", "TID", "TRY", "UP", "W"]
external = ["DOC", "PLR"]
exclude = ["samples/*"]
#extend-select = ["W", "N", "UP", "B", "A", "C4", "PT", "SIM", "PD", "PLE", "RUF"]
# Never enforce `E501` (line length violations).
ignore = [
# TODO: Fix unused function argument: `debug`, `kwargs`, and `method` in class Client
"ARG001", # ARG001 Unused function argument: `debug`, `kwargs`, and `method` in class Client
# TODO: Fix A001 Variable `TimeoutError` is shadowing a Python builtin
"A001" ,
# TODO: Fix A002 Argument `id` is shadowing a Python builtin
"A002",
"ANN401", # ANN401 Dynamically typed expressions (typing.Any) are disallowed in `**kwargs`
"B904", # Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None`
# pycodestyle (E, W)
"CPY001", # Missing copyright notice at top of file
"DOC501", # DOC501 Raised exception `TimeoutError` and `ApiError` missing from docstring
"E501",
"FBT001", # Boolean-typed positional argument in function definition
"FBT002", # Boolean default positional argument in function definition
# TODO: Replace with http.HTTPStatus, see https://docs.python.org/3/library/http.html#http-status-codes
"PLR2004", # PLR2004 Magic value used in comparison, consider replacing `XXX` with a constant variable
"PLR0913", # PLR0913 Too many arguments in function definition (6 > 5)
"PLR0917", # PLR0917 Too many positional arguments
"Q003", # Checks for avoidable escaped quotes ("\"" -> '"')
# TODO:" PT009 Use a regular `assert` instead of unittest-style `assertTrue`
"PT009",
"S311", # S311 Standard pseudo-random generators are not suitable for cryptographic purposes
# TODO: T201 Replace `print` with logging functions
"T201", # T201 `print` found
]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = ["B"]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = false
ignore-fully-untyped = false
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
[tool.ruff.format]
exclude = ["*.pyi"]
# Like Black, use double quotes for strings.
quote-style = "double"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
# Enable auto-formatting of code examples in docstrings. Markdown,
# reStructuredText code/literal blocks and doctests are all supported.
#
# This is currently disabled by default, but it is planned for this
# to be opt-out in the future.
#docstring-code-format = false
# Set the line length limit used when formatting code snippets in
# docstrings.
#
# This only has an effect when the `docstring-code-format` setting is
# enabled.
#docstring-code-line-length = "dynamic"
# Ignore `E402` (import violations) in all `__init__.py` files, and in `path/to/file.py`.
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402"]
#"path/to/file.py" = ["E402"]
[tool.ruff.lint.isort]
force-single-line = true
force-sort-within-sections = false
lines-after-imports = 2
[tool.ruff.lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
[tool.ruff.lint.pycodestyle]
ignore-overlong-task-comments = true
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.flake8]
exclude = ["samples/*"]
# TODO: D100 - create docstrings for modules test_client.py and test_version.py
ignore = ['E501', "D100"]
extend-ignore = "W503"
per-file-ignores = [
'__init__.py:F401',
]
max-line-length = 88
count = true
[tool.mypy]
strict = true
# Adapted from this StackOverflow post:
# https://stackoverflow.com/questions/55944201/python-type-hinting-how-do-i-enforce-that-project-wide
python_version = "3.9"
mypy_path = "type_stubs"
namespace_packages = true
# This flag enhances the user feedback for error messages
pretty = true
# 3rd party import
ignore_missing_imports = true
# flag to suppress Name <var> already defined on line
allow_redefinition = false
# Disallow dynamic typing
disallow_any_unimported = false
disallow_any_expr = false
disallow_any_decorated = false
disallow_any_explicit = false
disallow_any_generics = false
disallow_subclassing_any = true
# Disallow untyped definitions and calls
disallow_untyped_calls = true
disallow_untyped_defs = true
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_decorators = true
# None and optional handling
no_implicit_optional = true
# Configuring warnings
warn_return_any = false
warn_no_return = true
warn_unreachable = true
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = false
# Misc
follow_imports = "silent"
strict_optional = false
strict_equality = true
#exclude = '''(?x)(
# (^|/)test[^/]*\.py$ # files named "test*.py"
# )'''
exclude = [
"samples",
]
# Configuring error messages
show-fixes = true
show_error_context = false
show_column_numbers = false
show_error_codes = true
disable_error_code = 'misc'
[tool.pyright]
include = ["mailjet_rest"]
exclude = ["samples/*", "**/__pycache__"]
reportAttributeAccessIssue = false
reportMissingImports = false
[tool.bandit]
# usage: bandit -c pyproject.toml -r .
exclude_dirs = ["tests", "test.py"]
tests = ["B201", "B301"]
skips = ["B101", "B601"]
[tool.bandit.any_other_function_with_shell_equals_true]
no_shell = [
"os.execl",
"os.execle",
"os.execlp",
"os.execlpe",
"os.execv",
"os.execve",
"os.execvp",
"os.execvpe",
"os.spawnl",
"os.spawnle",
"os.spawnlp",
"os.spawnlpe",
"os.spawnv",
"os.spawnve",
"os.spawnvp",
"os.spawnvpe",
"os.startfile"
]
shell = [
"os.system",
"os.popen",
"os.popen2",
"os.popen3",
"os.popen4",
"popen2.popen2",
"popen2.popen3",
"popen2.popen4",
"popen2.Popen3",
"popen2.Popen4",
"commands.getoutput",
"commands.getstatusoutput"
]
subprocess = [
"subprocess.Popen",
"subprocess.call",
"subprocess.check_call",
"subprocess.check_output"
]