-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyproject.toml
321 lines (284 loc) · 8.5 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
[build-system]
requires = [
"setuptools ~= 65.3",
"wheel",
"build"
]
build-backend = "setuptools.build_meta"
[project]
name = "Observability"
version = "2.0.0"
description = "DataOops Observability"
urls = { "homepage" = "https://datakitchen.io" }
authors = [
]
license = { "file" = "LICENSE" }
readme = "README.md"
classifiers = [
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
]
requires-python = ">=3.10"
dependencies = [
"arrow~=1.2.2",
"apispec-webframeworks~=0.5.2",
"apispec~=6.2.0",
"APScheduler~=3.10.0",
"blinker~=1.5",
"boltons~=23.0.0",
"confluent-kafka~=2.1",
"flask~=2.2.2",
"gunicorn~=21.2.0",
"log-color==2.0.0",
"Marshmallow-Peewee~=3.4.3",
"marshmallow~=3.19.0",
"marshmallow-union==0.1.15.post1",
"msgpack==1.0.4",
"peewee~=3.16.0",
"PyJWT~=2.4",
"PyMySQL==1.0.2",
"pybars3~=0.9.7",
"requests_extensions~=1.1.3",
"tomli==2.0.1",
"Werkzeug==2.2.3",
"WTForms==3.0.1",
"yoyo-migrations~=8.2.0",
]
[project.optional-dependencies]
dev = [
"black~=23.1.0",
"invoke~=2.1.2",
"isort~=5.12.0",
"lxml~=4.9.1",
"mypy~=1.5.0",
"pre-commit~=2.20.0",
"pytest-cov~=4.0.0",
"pytest-xdist~=3.1.0",
"pytest~=7.2.0",
"pyyaml~=6.0",
"ruff==0.0.275",
"types-PyYAML~=6.0.8",
"types-requests==2.28.11.15",
"types-setuptools==65.3.0",
]
build = [
"build",
"setuptools~=65.3",
"wheel",
"trove-classifiers",
]
[project.entry-points.console_scripts]
cli = "cli.__main__:main"
rules-engine = "rules_engine.__main__:main"
run-manager = "run_manager.__main__:main"
scheduler = "scheduler.__main__:main"
[tool.setuptools]
include-package-data = true
[tool.setuptools.package-data]
"*" = ["*.toml", "*.html"]
"cli.graph_templates" = ["*.html"]
"common.peewee_extensions.templates" = ["*.toml"]
[tool.setuptools.packages.find]
# see the important note for why we glob. TL;DR: Otherwise you don't get submodules
# https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#finding-simple-packages
include = [
"agent_api*",
"observability_api*",
"common*",
"conf*",
"event_api*",
"cli*",
"rules_engine*",
"run_manager*",
"scheduler*",
"subcommand*",
]
exclude = [ "*.tests", "tests*", "deploy*", "scripts*", "testlib*"]
[tool.pytest.ini_options]
minversion = "7.0"
# --strict-markers means the markers have to be defined in this file before use, which prevents mispellings.
# --strict-config means that any warnings encountered while parsing the `pytest`configuration file will raise errors.
# -ra: show extra test data.
addopts = "-ra --strict-markers --strict-config --durations=10 "
python_files = "test_*.py"
python_classes = "Test_"
python_functions = "test_*"
# Look up "Testing Pyramid" for more insight into these markers.
markers = [
"unit: The test is a unit test and is thus expected to be fast with little setup",
"integration: The test is an integration test and is thus expected to be somewhat slower with a little more setup",
"functional: The test is a functional test and is thus expected to be slower with greater setup",
"converters_slow: Mark tests related to converting events that are known to be slow. Useful for filtering",
]
filterwarnings = [
# remove when resolved: https://github.com/marshmallow-code/apispec/issues/739
'ignore:distutils Version classes are deprecated:DeprecationWarning:apispec'
]
# see: https://mypy.readthedocs.io/en/stable/config_file.html#using-a-pyproject-toml-file
# for settings that do not have a comment,
# see: https://mypy.readthedocs.io/en/stable/config_file.html
# for an explanation of their functionality.
# WARNING: When changing mypy configurations, be sure to test them after removing your .mypy_cache
[tool.mypy]
python_version = "3.10"
check_untyped_defs = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
# This warns if any returns get cast to 'Any' due to type uncertainty by mypy. Since 'Any' is a valid return type
# for any function, returning any from a str function would be valid. This causes it to raise a warning instead.
warn_return_any = true
# This shows an error-code on failure, which is useful on debugging and possibly ignoring those particular
# lines if need-be.
show_error_codes = true
# This warns us if we're using '# type ignore' on a function which mypy knows it has definitions for.
# Hopefully this allows us to phase in type-checks on more libraries.
warn_unused_ignores = true
# Enables PEP 420 style namespace packages. This is a complex topic,
# but my reading suggests this is a generally 'good' idea.
# so see: https://mypy.readthedocs.io/en/stable/config_file.html#confval-namespace_packages
namespace_packages = true
warn_redundant_casts = true
# Remember that time you forgot to put a return in the function? This warns us of that.
# i.e.,
#
# def foo() -> str:
# x = 'a' + 'x'
# will return an error for not having the return it promised.
warn_no_return = true
# This attempts to warn us when we encounter code that is currently unreachable.
warn_unreachable = true
# Now for some configurations to improve our error messages Attempts to make the output prettier for us mere mortals.
pretty = true
# This tries to show some additional context around where the error is occuring
show_error_context = true
# Mypy appears smart enough to ignore hidden directories. But it needs to scan __pycache__ for .pyc and pyi files,
# so it cannot honor gitignore.
exclude = [
'''^(?:.*\/)+[tT]ests?''',
'conftest.py',
'venv/',
'build/',
'testlib/fixtures/',
'benchmark/',
]
[[tool.mypy.overrides]]
module = "peewee"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "playhouse.pool"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "playhouse.mysql_ext"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "playhouse.shortcuts"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "playhouse.hybrid"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "blinker"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "boltons.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "apispec"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "apispec.ext.marshmallow"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "apispec_webframeworks"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "apispec_webframeworks.flask"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "confluent_kafka"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "subcommand.subcmd"
ignore_errors = true
[[tool.mypy.overrides]]
module = "cli.lib"
check_untyped_defs = false
[[tool.mypy.overrides]]
module = "PIL.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "wtforms.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "invoke"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "apscheduler.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "msgpack.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "marshmallow_union.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "pybars"
ignore_missing_imports = true
[tool.isort]
profile = "black"
line_length = 120
[tool.black]
line-length = 120
target-version = ['py310']
include = '\.pyi?$'
exclude = '''
(
/(
\.eggs # exclude a few common directories in the
| \.git # root of the project
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| env
| venv
| _build
| buck-out
| build
| dist
)/
| foo.py # also separately exclude a file named foo.py in
# the root of the project
)
'''
# See: https://coverage.readthedocs.io/en/latest/config.html
[tool.coverage.run]
branch=true
# Every time there is a new top-level module, this will need to be expanded.
source = [
"agent_api",
"common",
"conf",
"observability_api",
"event_api",
"rules_engine",
"run_manager",
"scheduler",
]
[tool.coverage.report]
# We don't need to report the coverage lines on tests
omit = ["*/*tests/*"]
# This skips __init__.py and other empty files.
skip_empty=true
[tool.ruff]
target-version = "py310"
select = ["F401"]
ignore-init-module-imports = true
respect-gitignore = true
line-length = 120
[tool.ruff.extend-per-file-ignores]
"*/tests/*" = [
"F811", # Shadow unused imports; pytest fixtures
]