-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathpyproject.toml
280 lines (255 loc) · 8.69 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
[tool.poetry]
name = "airbyte"
description = "PyAirbyte"
authors = ["Airbyte <[email protected]>"]
readme = "README.md"
packages = [{ include = "airbyte" }]
# This project uses dynamic versioning
# https://github.com/mtkennerly/poetry-dynamic-versioning
version = "0.0.0"
[tool.poetry-dynamic-versioning]
enable = true
[tool.poetry.dependencies]
python = ">=3.9,<4.0"
airbyte-cdk = "^0.73.0"
duckdb = "0.9.2" # TODO: Change to "^0.10.0" once supported by MotherDuck
duckdb-engine = "0.9.2" # TODO: Change to "^0.10.0" once supported by MotherDuck
google-auth = ">=2.27.0,<3.0"
google-cloud-bigquery = ">=3.12.0,<4.0"
google-cloud-secret-manager = "^2.17.0"
jsonschema = ">=3.2.0,<5.0"
orjson = "3.9.15"
overrides = "^7.4.0"
pandas = ">=1.5.3,<=2.1.4" # 2.2.0 breaks sqlalchemy interop - TODO: optionally retest higher versions
pendulum = "<=3.0.0"
psycopg2-binary = "^2.9.9"
# psycopg = {extras = ["binary", "pool"], version = "^3.1.16"}
# Psycopg3 is not supported in SQLAlchemy 1.x:
pydantic = "<=2.0"
python-dotenv = "^1.0.1"
python-ulid = "^2.2.0"
requests = "^2.31.0"
rich = "^13.7.0"
snowflake-connector-python = "3.6.0"
snowflake-sqlalchemy = "^1.5.1"
sqlalchemy = "1.4.51"
types-pyyaml = "^6.0.12.12"
ulid = "^1.1"
# TODO: Remove this arbitrary python constraint once `sqlalchemy-bigquery` has done so.
sqlalchemy-bigquery = { version = "1.9.0", python = "<3.13" }
airbyte-api = "^0.49.2"
[tool.poetry.group.dev.dependencies]
docker = "^7.0.0"
faker = "^21.0.0"
mypy = "^1.7.1"
pandas-stubs = "^2.1.4.231218"
pdoc = "^14.3.0"
pytest = "^7.4.3"
pytest-docker = "^2.0.1"
pytest-mypy = "^0.10.3"
ruff = "^0.1.11"
types-jsonschema = "^4.20.0.0"
types-requests = "2.31.0.4"
freezegun = "^1.4.0"
airbyte-source-faker = "^6.0.0"
tomli = "^2.0"
responses = "^0.25.0"
airbyte-source-pokeapi = "^0.2.0"
pytest-mock = "^3.14.0"
[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
build-backend = "poetry_dynamic_versioning.backend"
[tool.pytest.ini_options]
addopts = "--strict-markers"
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"super_slow: these super slow tests will not run in CI; they will only ever run on-demand",
"requires_creds: marks a test as requiring credentials (skip when secrets unavailable)",
"linting: marks a test as a linting test",
]
[tool.ruff.pylint]
max-args = 8 # Relaxed from default of 5
max-branches = 15 # Relaxed from default of 12
[tool.ruff]
target-version = "py39"
select = [
# For rules reference, see https://docs.astral.sh/ruff/rules/
"A", # flake8-builtins
"ANN", # flake8-annotations
"ARG", # flake8-unused-arguments
"ASYNC", # flake8-async
"B", # flake8-bugbear
"FBT", # flake8-boolean-trap
"BLE", # Blind except
"C4", # flake8-comprehensions
"C90", # mccabe (complexity)
"COM", # flake8-commas
"CPY", # missing copyright notice
# "D", # pydocstyle # TODO: Re-enable when adding docstrings
"DTZ", # flake8-datetimez
"E", # pycodestyle (errors)
"ERA", # flake8-eradicate (commented out code)
"EXE", # flake8-executable
"F", # Pyflakes
"FA", # flake8-future-annotations
"FIX", # flake8-fixme
"FLY", # flynt
"FURB", # Refurb
"I", # isort
"ICN", # flake8-import-conventions
"INP", # flake8-no-pep420
"INT", # flake8-gettext
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"LOG", # flake8-logging
"N", # pep8-naming
"PD", # pandas-vet
"PERF", # Perflint
"PIE", # flake8-pie
"PGH", # pygrep-hooks
"PL", # Pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"PYI", # flake8-pyi
"Q", # flake8-quotes
"RET", # flake8-return
"RSE", # flake8-raise
"RUF", # Ruff-specific rules
"SIM", # flake8-simplify
"SLF", # flake8-self
"SLOT", # flake8-slots
"T10", # debugger calls
# "T20", # flake8-print # TODO: Re-enable once we have logging
"TCH", # flake8-type-checking
"TD", # flake8-todos
"TID", # flake8-tidy-imports
"TRY", # tryceratops
"TRY002", # Disallow raising vanilla Exception. Create or use a custom exception instead.
"TRY003", # Disallow vanilla string passing. Prefer kwargs to the exception constructur.
"UP", # pyupgrade
"W", # pycodestyle (warnings)
"YTT", # flake8-2020
]
ignore = [
# For rules reference, see https://docs.astral.sh/ruff/rules/
# These we don't agree with or don't want to prioritize to enforce:
"ANN003", # kwargs missing type annotations
"ANN101", # Type annotations for 'self' args
"ANN102", # Type annotations for 'cls' args
"COM812", # Because it conflicts with ruff auto-format
"EM", # flake8-errmsgs (may reconsider later)
"DJ", # Django linting
"G", # flake8-logging-format
"ISC001", # Conflicts with ruff auto-format
"NPY", # NumPy-specific rules
"PIE790", # Allow unnecssary 'pass' (sometimes useful for readability)
"PERF203", # exception handling in loop
"S", # flake8-bandit (noisy, security related)
"SIM910", # Allow "None" as second argument to Dict.get(). "Explicit is better than implicit."
"TD002", # Require author for TODOs
"TRIO", # flake8-trio (opinionated, noisy)
"INP001", # Dir 'examples' is part of an implicit namespace package. Add an __init__.py.
# TODO: Consider re-enabling these before release:
"A003", # Class attribute 'type' is shadowing a Python builtin
"BLE001", # Do not catch blind exception: Exception
"ERA001", # Remove commented-out code
"FIX002", # Allow "TODO:" until release (then switch to requiring links via TDO003)
"PLW0603", # Using the global statement to update _cache is discouraged
"TD003", # Require links for TODOs # TODO: Re-enable when we disable FIX002
"UP007", # Allow legacy `Union[a, b]` and `Optional[a]` for Pydantic, until we drop Python 3.9 (Pydantic doesn't like it)
]
fixable = ["ALL"]
unfixable = [
"ERA001", # Commented-out code (avoid silent loss of code)
"T201", # print() calls (avoid silent loss of code / log messages)
]
line-length = 100
extend-exclude = ["docs", "test", "tests"]
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.isort]
force-sort-within-sections = false
lines-after-imports = 2
known-first-party = ["airbyte_cdk", "airbyte_protocol"]
known-local-folder = ["airbyte"]
required-imports = ["from __future__ import annotations"]
known-third-party = []
section-order = [
"future",
"standard-library",
"third-party",
"first-party",
"local-folder",
]
[tool.ruff.mccabe]
max-complexity = 24
[tool.ruff.pycodestyle]
ignore-overlong-task-comments = true
[tool.ruff.pydocstyle]
convention = "google"
[tool.ruff.flake8-annotations]
allow-star-arg-any = false
ignore-fully-untyped = false
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
preview = false
docstring-code-format = true
[tool.mypy]
# Platform configuration
python_version = "3.9"
# imports related
ignore_missing_imports = true
follow_imports = "silent"
# None and Optional handling
no_implicit_optional = true
strict_optional = true
# Configuring warnings
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
warn_return_any = false
# Untyped definitions and calls
check_untyped_defs = true
disallow_untyped_calls = false
disallow_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_decorators = false
# Disallow dynamic typing
disallow_subclassing_any = true
disallow_any_unimported = false
disallow_any_expr = false
disallow_any_decorated = false
disallow_any_explicit = false
disallow_any_generics = false
# Miscellaneous strictness flags
allow_untyped_globals = false
allow_redefinition = false
local_partial_types = false
implicit_reexport = true
strict_equality = true
# Configuring error messages
show_error_context = false
show_column_numbers = false
show_error_codes = true
exclude = ["docs", "test", "tests"]
[[tool.mypy.overrides]]
module = ["airbyte_protocol", "airbyte_protocol.models"]
ignore_missing_imports = true # No stubs yet (😢)
[tool.pyright]
pythonVersion = "3.9"
venvPath = "./" # Assuming .venv is at the root of your project
venv = ".venv"
[tool.poetry.scripts]
generate-docs = "docs.generate:run"
airbyte-lib-validate-source = "airbyte.validate:run"
[tool.poe.tasks]
test = "pytest tests"
[tool.airbyte_ci]
extra_poetry_groups = ["dev"]
poe_tasks = ["test"]
required_environment_variables = ["GCP_GSM_CREDENTIALS"]
side_car_docker_engine = true