-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
pyproject.toml
263 lines (230 loc) · 11.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
[tool.poetry]
name = "tomodachi"
version = "0.28.2dev0"
description = "Microservice library on asyncio - HTTP server, websockets, pub/sub messaging for AWS SNS+SQS and RabbitMQ"
authors = ["Carl Oscar Aaro <[email protected]>"]
keywords = ["tomodachi", "microservice", "microservices", "framework", "library", "asyncio", "aws", "sns", "sqs", "amqp", "rabbitmq", "http", "websockets", "easy", "fast", "pubsub", "events", "event based messaging", "messages", "protocol buffers", "protobuf", "async", "message attributes", "filter policy", "distributed architecture", "scalable", "python 3"]
readme = "README.md"
license = "MIT"
homepage = "https://github.com/kalaspuff/tomodachi"
repository = "https://github.com/kalaspuff/tomodachi"
documentation = "https://tomodachi.dev/docs"
classifiers = [
"Development Status :: 4 - Beta",
"Framework :: aiohttp",
"Framework :: AsyncIO",
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Operating System :: POSIX",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Operating System :: MacOS :: MacOS X",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"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",
"Topic :: Software Development :: Libraries :: Application Frameworks",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Distributed Computing",
"Typing :: Typed"
]
packages = [
{ include = "tomodachi/" },
]
[tool.poetry.urls]
Changelog = "https://github.com/kalaspuff/tomodachi/blob/master/CHANGELOG.md"
[tool.poetry.dependencies]
python = "^3.9"
aioamqp = ">=0.13.0,<0.16.0"
aiobotocore = "^2.0.0"
tzlocal = ">=1.4,<6.0"
pytz = "*"
cchardet = { version = ">=2.1.7", python = "<3.10" }
aiohttp = ">=3.9.5,<3.11.0"
yarl = ">=1.16.0,<2.0.0"
colorama = ">=0.3.9,<0.5.0"
asahi = ">=0.1,<0.3"
structlog = ">=21.5.0,<25.0.0"
# derived from aiobotocore for dependency resolution speed in same cases.
botocore = ">=1.22.8"
# extras
protobuf = { version = ">=4.25.0", optional = true }
uvloop = { version = ">=0.14.0,<1.0.0", optional = true }
aiodns = { version = ">=1.2.0", optional = true }
Brotli = { version = "^1.0.9", optional = true }
# opentelemetry
opentelemetry-instrumentation = { version = ">=0.48b0,<1.0.0", allow-prereleases = true, optional = true }
opentelemetry-api = { version = ">=1.27.0,<2.0.0", optional = true }
opentelemetry-sdk = { version = ">=1.27.0,<2.0.0", optional = true }
opentelemetry-exporter-otlp = { version = ">=1.27.0,<2.0.0", optional = true }
opentelemetry-util-http = { version = ">=0.48b0,<1.0.0", allow-prereleases = true, optional = true }
opentelemetry-exporter-prometheus = { version = ">=0.48b0,<1.0.0", allow-prereleases = true, optional = true }
# extras management
asahi-extras = { version = "*", optional = true }
[tool.poetry.extras]
protobuf = ["protobuf"]
uvloop = ["uvloop"]
aiodns = ["aiodns"]
brotli = ["Brotli"]
opentelemetry = ["opentelemetry-instrumentation", "opentelemetry-api", "opentelemetry-sdk", "opentelemetry-exporter-otlp", "opentelemetry-util-http"]
opentelemetry-exporter-prometheus = ["opentelemetry-exporter-prometheus", "opentelemetry-instrumentation", "opentelemetry-api", "opentelemetry-sdk", "opentelemetry-exporter-otlp", "opentelemetry-util-http"]
instruments = ["tomodachi"]
aws = ["asahi-extras"] # ["aiobotocore", "botocore", "aiohttp"]
amqp = ["asahi-extras"] # ["aioamqp"]
http = ["asahi-extras"] # ["aiohttp"]
scheduler = ["asahi-extras"] # ["tzlocal", "pytz"]
color = ["asahi-extras"] # ["colorama"]
[tool.poetry.dev-dependencies]
# The dev dependencies look messy, but helps out to not get a bunch of win32 into the dev category.
flake8 = { version = ">=3.8.4", markers = "sys_platform != \"win32\"" }
flake8-black = { version = ">=0.2.0", markers = "sys_platform != \"win32\"" }
flake8-isort = { version = ">=4.0.0", markers = "sys_platform != \"win32\"" }
flake8-pyproject = { version = ">=1.1.0", markers = "sys_platform != \"win32\"" }
isort = { version = ">=5.6.0", markers = "sys_platform != \"win32\"", extras = ["plugins"] }
pytest = { version = ">=6.1.0", markers = "sys_platform != \"win32\"" }
pytest-cov = { version = ">=2.10.0", markers = "sys_platform != \"win32\"" }
pytest-rerunfailures = { version = ">=10.2", markers = "sys_platform != \"win32\"" }
pytest-xdist = { version = ">=2.5.0", markers = "sys_platform != \"win32\"" }
black = { version = "*", markers = "sys_platform != \"win32\"", allow-prereleases = true }
mypy = { version = ">=0.800", markers = "sys_platform != \"win32\"" }
codecov = { version = ">=2.1.13", markers = "sys_platform != \"win32\"" }
types-protobuf = { version = ">=0.1.13", markers = "sys_platform != \"win32\"" }
types-pytz = { version = ">=2021.1.0", markers = "sys_platform != \"win32\"" }
types-tzlocal = { version = ">=0.1.1", markers = "sys_platform != \"win32\"" }
types-setuptools = { version = ">=16.0", markers = "sys_platform != \"win32\"" }
types-aiobotocore = { version = ">=2.0.0,<3.0.0", markers = "sys_platform != \"win32\"", extras = ["sns", "sqs"] }
[tool.poetry.scripts]
tomodachi = "tomodachi.cli:cli_entrypoint"
[tool.poetry.plugins."opentelemetry_instrumentor"]
tomodachi = "tomodachi.opentelemetry:TomodachiInstrumentor"
[tool.poetry.plugins."opentelemetry_meter_provider"]
tomodachi_prometheus = "tomodachi.opentelemetry.prometheus:TomodachiPrometheusMeterProvider"
[tool.poetry.plugins."opentelemetry_metric_reader"]
tomodachi_prometheus = "tomodachi.opentelemetry.prometheus:TomodachiPrometheusMetricReader"
[tool.poetry.plugins."opentelemetry_distro"]
tomodachi = "tomodachi.opentelemetry.distro:OpenTelemetryDistro"
[tool.poetry.plugins."opentelemetry_configurator"]
tomodachi = "tomodachi.opentelemetry.distro:OpenTelemetryConfigurator"
[tool.poetry.plugins."opentelemetry_environment_variables"]
tomodachi = "tomodachi.opentelemetry.environment_variables"
[build-system]
requires = ["poetry_core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.black]
line-length = 120
target_version = ["py38", "py39", "py310", "py311", "py312"]
include = '\.pyi?$'
exclude = '\.eggs/|tomodachi\.egg-info/|\.git/|\.mypy_cache/|\.venv/|\.pytest_cache/|\.vscode/|__pycache__/|build/|dist/|proto_build/|syntax_error_service\.py|setup\.py'
[tool.isort]
profile = "black"
line_length = 120
src_paths = ["tomodachi", "tests", "examples"]
known_first_party = ["tomodachi", "run_test_service_helper", "proto_build"]
known_third_party = ["opentelemetry"]
skip = [".mypy_cache", ".pytest_cache", "__pycache__", "tomodachi.egg-info", ".eggs", "syntax_error_service.py", ".git", ".venv", ".vscode", "build", "dist", "tmp"]
[tool.ruff]
line-length = 120
target-version = "py38"
select = [
"F", # pyflakes
"E", # pycodestyle (erorr)
"I", # isort
"W", # pycodestyle (warning)
"C901", # complex-structure
"UP", # pyupgrade
"N", # pep8-naming
"B", # flake8-bugbear
"DTZ", # flake8-datetimez
"Q", # flake8-quotes
"T20", # flake8-print
"PL", # pylint
"PIE", # flake8-pie
"RET", # flake8-return
"SLF", # flake8-self
"SIM", # flake8-simplify
"PGH", # pygrep-hooks
"RUF", # ruff-specific
"PT", # flake8-pytest-style
"C4", # flake8-comprehensions
"A", # flake8-builtins
"BLE", # flake8-blind-except
"S", # flake8-bandit
]
extend-select = ["I"]
ignore = [
"UP007", # union type annotations
"UP006", # type instead of Type
"SIM105", # try-catch-pass
"S110", # try-catch-pass (logging)
"BLE001", # blind exception
"SLF001", # private attribute access
"I001", # isort
"PLR0913", # too many arguments
"UP037", # type annotation with quotes
"B008", # function calls in argument defaults
]
src = [
"tomodachi",
"tests",
]
[tool.ruff.lint.isort]
known-first-party = ["tomodachi", "run_test_service_helper", "proto_build"]
known-third-party = ["opentelemetry", "prometheus_client"]
[tool.ruff.per-file-ignores]
"tests/**/*.py" = [
"S101", # assert
"PLR2004", # magic-value-comparison
]
"tomodachi/**/*_pb2.py*" = [
"UP009", # utf-8 encoding
"SLF001", # private member accessed
"E501", # line too long
"I001", # isort
"UP036", # version block outdated
"N802", # camelcase function
"N816", # mixedcase variable
]
[tool.mypy]
pretty = true
files = ["$MYPY_CONFIG_FILE_DIR/tomodachi", "$MYPY_CONFIG_FILE_DIR/tests/type_hinting_validation.py"]
ignore_missing_imports = true
show_error_codes = true
no_implicit_reexport = true
no_implicit_optional = true
strict_equality = true
strict_optional = true
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
local_partial_types = true
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_return_any = true
warn_unreachable = true
[tool.flake8]
ignore = ["E203", "E501", "W503", "E231", "E202", "E704", "E225"]
exclude = ["tomodachi.egg-info", ".git", ".mypy_cache", ".pytest_cache", ".venv", ".vscode", "__pycache__", "build", "dist", "proto_build", "tmp"]
[tool.pytest.ini_options]
filterwarnings = [
"ignore:Assigning a dict or dict-like mapping to 'service.options' is deprecated. Use the 'tomodachi.Options' class instead.:DeprecationWarning:tomodachi",
"ignore:Using the '@tomodachi.service' decorator is deprecated. Service classes should instead inherit from the 'tomodachi.Service' class.:DeprecationWarning:tomodachi",
"ignore:Using the 'service.log_setup\\(\\)' function is deprecated and has no effect. Use the structlog logger from 'tomodachi.logging.get_logger\\(\\)' instead.:DeprecationWarning:tomodachi",
"ignore:Using the 'service.log\\(\\)' function is deprecated. Use the structlog logger from 'tomodachi.logging.get_logger\\(\\)' instead.:DeprecationWarning:tomodachi",
"ignore:Using the 'RequestHandler.get_request_ip\\(\\)' function is deprecated. Use the 'tomodachi.get_forwarded_remote_ip\\(\\)' function instead.:DeprecationWarning:tomodachi",
"ignore:Using the -c \\(--config\\) CLI argument is deprecated. Set and parse service config with environment variables instead.:DeprecationWarning:tomodachi",
"ignore:Using the 'discovery' interface is deprecated. Please implement lifecycle hooks for your service instead.:DeprecationWarning:tomodachi",
"ignore:'cgi' is deprecated and slated for removal in Python 3\\.13:DeprecationWarning:aiohttp",
"ignore:pkg_resources is deprecated as an API. See .*:DeprecationWarning:opentelemetry.instrumentation",
"ignore:Deprecated call to `pkg_resources.declare_namespace.*:DeprecationWarning:pkg_resources",
"ignore:Type google._upb._message.MessageMapContainer uses PyType_Spec with a metaclass that has custom tp_new..*:DeprecationWarning:importlib._bootstrap",
"ignore:Type google._upb._message.ScalarMapContainer uses PyType_Spec with a metaclass that has custom tp_new..*:DeprecationWarning:importlib._bootstrap",
"ignore:datetime.datetime.utcnow\\(\\) is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC:DeprecationWarning:botocore.auth",
"ignore:unread_data\\(\\) is deprecated and will be removed in future releases \\(#3260\\):DeprecationWarning:tomodachi.transport.http",
]
[tool.coverage.run]
omit = ["examples/*", "tests/*", "tomodachi/__main__.py", "tomodachi/__version__.py"]