forked from meltano/meltano
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
597 lines (556 loc) · 17.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
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
[tool.poetry]
name = "meltano"
version = "3.1.0"
description = "Meltano is your CLI for ELT+: Open Source, Flexible, and Scalable. Move, transform, and test your data with confidence using a streamlined data engineering workflow you’ll love."
authors = ["Meltano <[email protected]>"]
license = "MIT"
readme = "README.md"
repository = "https://github.com/meltano/meltano"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
packages = [
{ include = "meltano", from = "src", format = "wheel" },
{ include = "src", format = "sdist" },
{ include = "tests", format = "sdist"},
]
keywords = [
"Meltano",
"ELT",
"Data integration",
"singer-io",
"dbt",
]
documentation = "https://docs.meltano.com"
homepage = "https://meltano.com"
[tool.poetry.urls]
"Changelog" = "https://github.com/meltano/meltano/blob/main/CHANGELOG.md"
"Issue Tracker" = "https://github.com/meltano/meltano/issues"
"Slack" = "https://meltano.com/slack"
"Twitter" = "https://twitter.com/meltanodata/"
"Youtube" = "https://www.youtube.com/meltano"
[tool.poetry.dependencies]
aiodocker = "^0.21.0"
aiohttp = "^3.8.6"
alembic = "^1.12.1"
atomicwrites = "^1.2.1"
azure-common = {version = "^1.1.28", optional = true}
azure-core = {version = "^1.29.5", optional = true}
azure-identity = {version = "^1.15.0", optional = true}
azure-storage-blob = {version = "^12.18.3", optional = true}
boto3 = {version = "^1.28.73", optional = true}
check-jsonschema = "^0.22.0"
click = "^8.1"
click-default-group = "^1.2.4"
click-didyoumean = "^0.3.0"
croniter = "^2.0.1"
fasteners = "^0.19"
flatten-dict = "^0"
google-cloud-storage = {version = ">=1.31.0", optional = true}
importlib-resources = "^6.1.0"
jinja2 = "^3.1.2"
jsonschema = "^4.19"
packaging = "^23.2"
platformdirs = "^3.11.0"
psutil = "^5.9.6"
psycopg = {version = "^3.1.12", extras = ["binary"], optional = true}
psycopg2-binary = {version="^2.9.9", optional=true}
pyjwt = "^2.6.0"
pymssql = {version = "^2.2.10", optional = true}
python = ">=3.8,<3.13"
python-dateutil = "^2.8.2"
python-dotenv = "^1.0.0"
python-slugify = "^8.0.1"
python-ulid = "^1.1.0"
pyyaml = "^6.0.1"
questionary = "^2.0.1"
requests = "^2.31.0"
rich = "^13.6.0"
"ruamel.yaml" = "^0.17.21"
setuptools = {version = "^68.2.2", python = ">=3.12"}
smart-open = "^6.4.0"
snowplow-tracker = "^1.0.1"
sqlalchemy = "^2.0.22"
structlog = "^23.2.0"
tabulate = "^0.9.0"
typing-extensions = "^4.8.0"
tzlocal = "^5.2"
# Compatibility issues with boto: https://github.com/boto/botocore/pull/3034
urllib3 = "<2"
virtualenv = "^20.24.6"
yaspin = "^2.3.0"
[tool.poetry.extras]
azure = ["azure-storage-blob", "azure-common", "azure-core", "azure-identity"]
gcs = ["google-cloud-storage"]
mssql = ["pymssql"]
postgres = ["psycopg"]
psycopg2 = ["psycopg2-binary"]
s3 = ["boto3"]
[tool.poetry.group.dev.dependencies]
backoff = "^2.1.2"
black = "^23.10.1"
boto3-stubs = {extras = ["essential"], version = "1.28.78"}
bumpversion = "^0.6.0"
colorama = "^0.4.4"
coverage = {extras = ["toml"], version = "^7.3.2"}
freezegun = "^1.2.2"
hypothesis = "^6.88.3"
mock = "^5.0.2"
moto = "^4.2.7"
mypy = "^1.6.1"
pre-commit = "^3.5.0"
pytest = "^7.4.3"
pytest-aiohttp = "^1.0.5"
pytest-asyncio = "^0.21.1"
pytest-cov = "^4.1.0"
pytest-docker = "^2.0"
pytest-httpserver = "^1.0.6"
pytest-order = "^1.0"
pytest-randomly = "^3.12"
pytest-rerunfailures = "^12.0"
pytest-structlog = "^0.6"
pytest-xdist = "^3.3"
requests-mock = "^1.11.0"
setproctitle = "^1.3" # Used by pytest-xdist to aid with handling resource intensive processes.
types-croniter = "^2.0.0"
types-jsonschema = "^4.19.0.4"
types-psutil = "^5.9.5.17"
types-python-dateutil = "^2.8.19.14"
types-python-slugify = "^8.0.0.2"
types-pyyaml = "^6.0.12.12"
types-requests = "^2.31.0"
types-tabulate = "^0.9.0.1"
[tool.poetry.scripts]
meltano = "meltano.cli:main"
[tool.black]
line-length = 88
[tool.flakeheaven]
accept_encodings = "utf-8"
baseline = "flakeheaven-baseline"
docstring_style = "google"
doctests = true
enable_extensions = "G"
exclude = [
".nox/",
".venv",
"venv",
"*.md",
"src/meltano/migrations/",
]
format = "colored"
inline_quotes = "double"
max_complexity = 6
max_imports = 20
max_line_length = 88
show_source = true
statistics = true
[tool.flakeheaven.plugins]
"flake8-*" = [
"+*",
]
"flake8-isort" = [
"-*",
]
"flake8-commas" = [
"-*",
]
"flake8-bandit" = [
"-*",
]
"flake8-string-format" = [
"-P101", # Allow format strings with unindex parameters (because the pyupgrade pre-commit hook enforces their usage)
]
"flake8-rst-docstrings" = [
"-*",
]
mccabe = [
"+*",
]
"pep8-naming" = [
"+*",
"-N818", # Allow Exceptions to have suffix 'Exception' rather than 'Error'
]
pycodestyle = [
"+*",
"-E203", # Let Black put whitespace before :
"-W503", # Allow for line breaks where Black decides are valid
]
pyflakes = [
"+*",
]
"wemake-python-styleguide" = [
"+*",
"-WPS100",
"-WPS110", # Allow blacklisted variable names that can be clear enough in method context
"-WPS111",
"-WPS112",
"-WPS115", # Allow upper-case constants in Enum subclasses
"-WPS201",
"-WPS202", # Allow many module members
"-WPS211", # Allow "too many"
"-WPS212", # Ignore 'too many return statements' - noqa parse inconsistent between py38 vs prior
"-WPS220",
"-WPS221",
"-WPS226",
"-WPS229",
"-WPS231",
"-WPS232",
"-WPS237",
"-WPS300", # Allow local folder imports (import .module)
"-WPS305", # Allow f-strings
"-WPS306", # Ignore missing base class, required by pyupgrade: https://github.com/asottile/pyupgrade#rewrites-class-declaration
"-WPS309", # Allow reversed compare order
"-WPS316",
"-WPS317", # Allow "incorrect multi-line parameters", since Black forces them to be "incorrect"
"-WPS324", # Allow inconsistent returns - permitted because of too many false positives
"-WPS326", # Allow syntax-level (process when first parsed, rather than at every run) string concatenation
"-WPS332", # Allow assignment expressions (walrus operator :=)
"-WPS337",
"-WPS338", # Allow 'incorrect' order of methods in a class
"-WPS348", # Allow `.` at beginning of line to accommodate Black formatting of multiline chained function calls
"-WPS352",
"-WPS354", # Allow consecutive yield expressions
"-WPS402", # Allow "overuse" of noqa comments.
"-WPS404",
"-WPS407",
"-WPS410", # Allow metadata variable (__all__)
"-WPS412",
"-WPS414", # Allow unpacking assignments
"-WPS420", # Allow `pass` keywords in `except` bodies to prevent falling through to another `except`
"-WPS429",
"-WPS430",
"-WPS431", # Allow nested classes
"-WPS433",
"-WPS440", # Allow block variable overlap, e.g. multiple for-loops that use the same name for their loop variables
"-WPS441", # Allow control variables to be used after their block, because this rule has too many false-positives
"-WPS454",
"-WPS458", # Import name collisions - disabled because it raises many false positives
"-WPS461", # Allow all inline ignores
"-WPS501",
"-WPS507",
"-WPS509", # Allow "incorrect" ternary expressions
"-WPS528", # Allow iterating over keys in a dict, then using them to access values
"-WPS529", # Allow use of `dict_object[key]` (i.e. `dict.__getitem__`) instead of `dict.get`
"-WPS600", # Allow subclassing a builtin, such as 'str' (used for serializable Enums)
"-WPS602", # Allow using @staticmethod
"-WPS615", # Allow "unpythonic" getters and setters
]
[tool.flakeheaven.exceptions."*tests/*"]
# Don't require docstrings in tests
"flake8-darglint" = [
"-DAR101",
"-DAR201",
"-DAR301",
]
"flake8-docstrings" = [
"-D100",
"-D101",
"-D102",
"-D103",
"-D104",
"-D105",
"-D107",
]
"flake8-string-format" = [
"-P103", # String does contain unindexed parameters
]
"wemake-python-styleguide" = [
"-WPS114", # Allow underscored number name pattern (e.g. tap_covid_19)
"-WPS204", # Don't warn on overused expressions in test methods
"-WPS211", # Don't warn on too many arguments in test methods
"-WPS210", # Don't warn on too many local variables in test methods
"-WPS218", # Don't warn on too many `assert` statements in test methods
"-WPS213", # Found too many expressions
"-WPS214", # Don't warn on too many methods in test modules
"-WPS217", # Don't warn about there being too many await expressions
"-WPS226", # Don't warn on too many string constants in test methods
"-WPS316", # Context manager with too many assignments
"-WPS442", # Allow outer scope name shadowing for fixtures
"-WPS430", # Allow nested functions in test methods
"-WPS432", # Allow magic numbers
"-WPS437", # Allow protected attribute usage in test methods
"-WPS201", # Found module with too many imports
"-WPS425", # Found boolean non-keyword argument
"-WPS118", # Found too long name
"-WPS342", # Avoid false positive for implicit raw strings
]
[tool.flakeheaven.exceptions."!*tests/*"]
"flake8-debugger" = [
"-T100",
]
[tool.flakeheaven.exceptions."scripts/*"]
"wemake-python-styleguide" = [
"-WPS421", # Allow for print function calls
]
[tool.flakeheaven.exceptions."*/cli/*"]
"flake8-docstrings" = [
"-D301", # Allow backslashes in dosctrings
]
"flake8-darglint" = [
"-*", # Don't require docstrings in click commands
]
"wemake-python-styleguide" = [
"-WPS210", # Allow many local variables, since these aid in string building
"-WPS211", # Allow many arguments, since these often represent CLI arguments
"-WPS213", # Allow many expressions, since string building requires them
"-WPS216", # Allow many decorators, since `click` uses them to define the CLI
"-WPS202", # Allow many module members
"-WPS204", # Allow 'overuse' of expressions (e.g. ctx.obj["-settings"])
]
[tool.flakeheaven.exceptions."src/meltano/migrations/versions/*"]
"flake8-docstrings" = [
"-D101", # Don't class docstrings in migrations
"-D103", # Don't require function docstrings in migrations
"-D400", # Don't require periods in the first lines of dosctrings
]
"pep8-naming" = [
"-N806", # Allow uppercase variable names
]
"wemake-python-styleguide" = [
"-WPS102", # Allow module names starting with numbers
"-WPS118", # Allow long filenames
"-WPS204", # Allow expression "-overuse"
"-WPS226", # Allow string constant "-overuse"
"-WPS432", # Allow "-magic" numbers
]
[tool.flakeheaven.exceptions."src/meltano/core/job/job.py"]
"wemake-python-styleguide" = [
"-WPS601", # Class attributes can be used as instance attributes in sqlalchemy.declarative model
]
[tool.flakeheaven.exceptions."src/meltano/core/project_files.py"]
"wemake-python-styleguide" = [
"-WPS226", # Dict manipulation requires lots of string constant references
]
[tool.flakeheaven.exceptions."src/meltano/core/project_init_service.py"]
"wemake-python-styleguide" = [
"-WPS226", # Found string constant over-use: blue > 3
"-WPS213", # Found too many expressions: 27 > 9
]
[tool.flakeheaven.exceptions."src/**/__init__.py"]
pyflakes = [
"-F401", # Allow for using __init__.py to promote imports to the module namespace
]
[tool.flakeheaven.exceptions."tests/**/__init__.py"]
pyflakes = [
"-F401", # Allow for using __init__.py to promote imports to the module namespace
]
# Don't require docstrings in tests
"flake8-darglint" = [
"-DAR101",
"-DAR201",
"-DAR301",
]
"flake8-docstrings" = [
"-D100",
"-D101",
"-D102",
"-D103",
"-D104",
]
[tool.flakeheaven.exceptions."src/meltano/__init__.py"]
"wemake-python-styleguide" = [
"-WPS412", # Found `__init__.py` module with logic
"-WPS410", # Found wrong metadata variable
]
[tool.flakeheaven.exceptions."src/meltano/core/block/extract_load.py"]
"wemake-python-styleguide" = [
"-WPS201", # Found module with too many imports: 21 > 20
]
[tool.flakeheaven.exceptions."src/meltano/core/logging/utils.py"]
"wemake-python-styleguide" = [
"-WPS100", # Found wrong module name
]
[tool.flakeheaven.exceptions."src/meltano/core/cli_messages.py"]
# Special exceptions for cli magic
"wemake-python-styleguide" = [
"-WPS114",
"-WPS360",
]
pycodestyle = [
"-W291",
"-W293",
]
[tool.flakeheaven.exceptions."src/meltano/core/settings_store.py"]
"wemake-python-styleguide" = [
"-WPS204", # Found overused expression: allow settings store implementations to all return vars with the same names
]
[tool.flakeheaven.exceptions."src/meltano/core/utils/__init__.py"]
"flake8-docstrings" = [
"-D103", # Many of these utility functions are descriptively named and self-documenting
]
[tool.flakeheaven.exceptions."src/meltano/core/state_store/*"]
"wemake-python-styleguide" = [
"-WPS428", # Ignore ... in ABC
]
[tool.flakeheaven.exceptions."src/meltano/core/state_store/__init__.py"]
"wemake-python-styleguide" = [
"-WPS320", # Ignore multi-line function annotations
]
[tool.pytest.ini_options]
addopts = "--cov=meltano --cov=tests --doctest-modules --order-scope=module -ra -n auto --dist=loadfile"
asyncio_mode = "auto"
log_cli = 1
log_cli_format = "%(message)s"
log_cli_level = "CRITICAL"
log_file = "pytest.log"
log_file_date_format = "%Y-%m-%d %H:%M:%S"
log_file_format = "%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)"
log_file_level = "DEBUG"
markers = [
"backend(type): backend specific test",
"meta: meta test",
"concurrent: test requires true concurrency",
"slow: slow test",
]
testpaths = [
"tests/",
]
[tool.coverage.run]
branch = true
concurrency = [
"multiprocessing",
"thread",
]
parallel = true
source = [
"meltano",
"tests",
]
[tool.coverage.paths]
source = [
"src/meltano/",
"**/site-packages/meltano/",
"**/site-packages/meltano*/meltano/",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
'''if (t\.)?TYPE_CHECKING:''',
"\\.\\.\\.",
]
precision = 2
show_missing = true
skip_covered = true
[tool.commitizen]
name = "cz_version_bump"
tag_format = "v$major.$minor.$patch$prerelease"
version = "3.1.0"
version_files = [
"pyproject.toml:^version =",
"src/meltano/__init__.py:^__version__ =",
'docs/package.json:^ "version":',
]
[tool.mypy]
incremental = false # Disabled until https://github.com/python/mypy/issues/12664 is resolved
files = [
"src/meltano/",
]
exclude = [
"src/meltano/migrations/",
]
warn_unused_configs = true
warn_unused_ignores = true
# The following whitelist is used to allow for incremental adoption
# of MyPy. Modules should be removed from this whitelist as and when
# their respective type errors have been addressed. No new modules
# should be added to this whitelist.
[[tool.mypy.overrides]]
ignore_errors = true
module = [
"meltano.cli.*",
# Way too many modules at the root of meltano.core to tackle them all at once # so listing them individually here.
"meltano.core.db",
"meltano.core.elt_context",
"meltano.core.meltano_invoker",
"meltano.core.migration_service",
"meltano.core.models",
"meltano.core.plugin_install_service",
"meltano.core.plugin_invoker",
"meltano.core.plugin_test_service",
"meltano.core.project",
"meltano.core.project_add_service",
"meltano.core.project_files",
"meltano.core.project_plugins_service",
"meltano.core.project_settings_service",
"meltano.core.select_service",
"meltano.core.settings_service",
"meltano.core.settings_store",
"meltano.core.sqlalchemy",
"meltano.core.task_sets_service",
"meltano.core.transform_add_service",
# Meltano Core submodules
"meltano.core.behavior.*",
"meltano.core.block.*",
"meltano.core.job.*",
"meltano.core.logging.job_logging_service",
"meltano.core.logging.output_logger",
"meltano.core.logging.utils",
"meltano.core.plugin.*",
"meltano.core.runner.*",
"meltano.core.tracking.*",
"meltano.core.utils.*",
]
[build-system]
requires = ["poetry-core==1.7.0"]
build-backend = "poetry.core.masonry.api"
[tool.ruff]
target-version = "py38"
line-length = 88
exclude = [
"src/meltano/migrations/*",
]
ignore = [
"ANN101", # Missing type annotation for `self` in method
"ANN102", # Missing type annotation for `cls` in class method
"PT004", # Add leading underscore to fixtures that do not return anything
"UP026", # Replace `mock` import with `unittest.mock` - remove once Python 3.7 support is dropped
"S310", # Allow `urllib.open`
"S603", # Allow `subprocess.run(..., shell=False)`
]
select = [
"ARG", # flake8-unused-arguments
"S", # flake8-bandit
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"COM", # flake8-commas
"E", # pycodestyle (error)
"F", # pyflakes
"I", # isort
"ISC", # flake8-implicit-str-concat
"PT", # flake8-pytest-style
"RSE", # flake8-raise
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
"UP", # pyupgrade
"W", # pycodestyle (warning)
"TID", # flake8-tidy-imports
]
[tool.ruff.per-file-ignores]
"src/meltano/**/__init__.py" = [
"F401", # Permit unused imports in `__init__.py` files
]
"tests/**" = [
"S101", # Allow 'assert' in tests
]
[tool.ruff.flake8-annotations]
allow-star-arg-any = true
mypy-init-return = true
suppress-dummy-args = true
[tool.ruff.flake8-pytest-style]
parametrize-values-type = "tuple"
[tool.ruff.isort]
known-first-party = ["asserts", "fixtures", "meltano"]
required-imports = ["from __future__ import annotations"]
[tool.ruff.pydocstyle]
convention = "google"
[tool.ruff.flake8-tidy-imports.banned-api]
"meltano.cli.cli.command".msg = "Use `click.command` and `meltano.cli.cli.add_command` instead"
"meltano.cli.cli.group".msg = "Use `click.group` and `meltano.cli.cli.add_command` instead"