-
Notifications
You must be signed in to change notification settings - Fork 233
/
pyproject.toml
171 lines (152 loc) · 5.03 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
[build-system]
requires = ["setuptools >=61", "wheel", "Cython >=3.0.5"]
[project]
name = "aiokafka"
description = "Kafka integration with asyncio"
readme = "README.rst"
requires-python = ">=3.9"
license = { file = "LICENSE" }
authors = [
{ name = "Andrew Svetlov", email = "andrew.svetlov@gmail.com" },
]
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Intended Audience :: Developers",
"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",
"Operating System :: OS Independent",
"Topic :: System :: Networking",
"Topic :: System :: Distributed Computing",
"Framework :: AsyncIO",
"Development Status :: 4 - Beta",
]
dynamic = ["version"]
dependencies = [
"async-timeout",
"packaging",
"typing_extensions >=4.10.0",
]
[project.optional-dependencies]
snappy = ["cramjam"]
# v2.8.0 adds support for independent-block mode
lz4 = ["cramjam >=2.8.0"]
zstd = ["cramjam"]
gssapi = ["gssapi"]
all = ["cramjam >=2.8.0", "gssapi"]
[tool.setuptools.dynamic]
version = { attr = "aiokafka.__version__" }
[tool.setuptools]
include-package-data = false
[tool.setuptools.packages.find]
include = [
"aiokafka",
"aiokafka.*",
]
[project.urls]
Documentation = "http://aiokafka.readthedocs.org"
Source = "https://github.com/aio-libs/aiokafka"
Changes = "https://github.com/aio-libs/aiokafka/blob/master/CHANGES.rst"
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
addopts = ["--strict-config", "--strict-markers"]
markers = [
"ssl: Tests that require SSL certificates to run",
]
filterwarnings = [
"error",
# FIXME Until we fix socket leaks in tests
"default:unclosed event loop:ResourceWarning",
]
[tool.coverage.run]
branch = true
source_pkgs = ["aiokafka", "tests"]
[tool.coverage.report]
show_missing = true
skip_covered = true
skip_empty = true
[tool.ruff.lint]
# For the reference, check https://docs.astral.sh/ruff/rules/
select = [
"F", # pyflakes
"E", "W", # pycodestyle
"I", # isort
"UP", # pyupgrade
"YTT", # flake8-2020
# TODO Uncomment after adding annotations to all modules
# All "ANN" rules are covered by mypy, except "ANN204"
# "ANN204", # Missing return type annotation for special method ...
"ASYNC", # flake8-async
"S", # flake8-bandit
"BLE", # flake8-blind-except
"B", # flake8-bugbear
"A", # flake8-builtins
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"T10", # flake8-debugger
"EXE", # flake8-executable
"FA", # flake8-future-annotations
# XXX Causes warning https://github.com/astral-sh/ruff/issues/8272
"ISC", # flake8-implicit-str-concat
"G", # flake8-logging-format
"INP", # flake8-no-pep420
"PIE", # flake8-pie
"T20", # flake8-print
# TODO Uncomment after completely moving to pytest style
# "PT", # flake8-pytest-style
# The rest of RET rules don't improve code and may even worsen readability
"RET501", "RET502", "RET503", # flake8-return
"SLOT", # flake8-slots
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
"PTH", # flake8-use-pathlib
# "FIX", # flake8-fixme
"PGH", # pygrep-hooks
"PL", # Pylint
"TRY", # tryceratops
"PERF", # Perflint
# "LOG", # flake8-logging
"RUF", # Ruff-specific
]
ignore = [
"S101", # Use of `assert` detected
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
"B011", # Do not `assert False`
"SIM108", # Use ternary operator
# TODO Remove when we drop support for Python <=3.10
"SIM117", # Use a single `with` statement with multiple contexts
"PLR0913", # Too many arguments in function definition
"PLR2004", # Magic value used in comparison
# TODO Reduce complexity
"PLR0911", "PLR0912", "PLR0915", # Too many ...
# Too many false positives
"PLW2901", # ... loop variable ... overwritten by assignment target
"TRY003", # Avoid specifying long messages outside the exception class
"TRY400", # Use `logging.exception` instead of `logging.error`
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
]
pyupgrade.keep-runtime-typing = true
[tool.ruff.lint.per-file-ignores]
"tests/**.py" = [
"S106", "S107", # Possible hardcoded password
"S603", # `subprocess` call: check for execution of untrusted input
"S607", # Starting a process with a partial executable path
"T201", # `print` found
]
[tool.ruff.format]
docstring-code-format = true
[tool.mypy]
python_version = "3.9"
disable_error_code = "import-untyped"
check_untyped_defs = true
disallow_any_generics = true
disallow_untyped_defs = true
strict_equality = true
warn_redundant_casts = true
warn_unused_ignores = true
follow_imports = "silent" # FIXME Remove after adding annotations
local_partial_types = true # TODO Remove when it becomes default