-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathpyproject.toml
More file actions
275 lines (239 loc) · 8.76 KB
/
Copy pathpyproject.toml
File metadata and controls
275 lines (239 loc) · 8.76 KB
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
[project]
name = "exabel"
description = "Python SDK for the Exabel Data API"
version = "9.0.0"
license = "MIT"
license-files = ["LICENSE"]
readme = "README.md"
authors = [
{ name = "Exabel", email = "support@exabel.com" }
]
requires-python = ">=3.10"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Financial and Insurance Industry",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Operating System :: OS Independent",
]
dependencies = [
"google-api-core>1.31.3",
"googleapis-common-protos>=1.56.0",
"grpcio>=1.78.0",
"openpyxl",
"pandas",
"protobuf>=6",
"requests",
"tqdm",
]
[dependency-groups]
dev = [
"ruff",
"mypy",
"pytest",
"pyarrow",
"types-protobuf",
"types-python-dateutil",
"types-requests",
]
[project.optional-dependencies]
snowflake = ["snowflake-connector-python[pandas]", "snowflake-sqlalchemy"]
bigquery = ["google-cloud-bigquery", "sqlalchemy-bigquery"]
athena = ["pyathena", "pyarrow", "sqlalchemy"]
export = ["pyarrow"]
[project.urls]
Homepage = "https://github.com/Exabel/python-sdk"
Documentation = "https://help.exabel.com"
Source = "https://github.com/Exabel/python-sdk"
Changelog = "https://github.com/Exabel/python-sdk/releases"
[build-system]
requires = ["uv_build>=0.11.15,<0.12"]
build-backend = "uv_build"
[tool.uv]
package = true
[tool.uv.build-backend]
module-name = "exabel"
module-root = ""
source-exclude = [
"exabel/tests/**",
]
wheel-exclude = [
"exabel/tests/**",
]
[tool.mypy]
python_version = "3.10"
# Searching for installed packages in mypy apparently does not play well with pipenv.
ignore_missing_imports = true
check_untyped_defs = true
disallow_untyped_defs = true
show_error_codes = true
strict_equality = true
warn_unreachable = true
namespace_packages = true
local_partial_types = true
# Warning disabled due to inconsistent behaviour depending on whether .mypy_cache exists or not.
warn_unused_ignores = false
[[tool.mypy.overrides]]
module = "*.tests.*"
disallow_untyped_defs = false
check_untyped_defs = false
disable_error_code = ["annotation-unchecked"]
[[tool.mypy.overrides]]
module = [
"google.*",
"google.api_core.*",
"google.cloud.*",
]
ignore_errors = true
follow_imports = "skip"
[[tool.mypy.overrides]]
module = "exabel.stubs.*"
disallow_untyped_defs = false
disable_error_code = ["name-defined"]
[tool.ruff]
src = ["exabel"]
force-exclude = true
extend-exclude = ["stubs"]
line-length = 100
indent-width = 4
target-version = "py310"
[tool.ruff.lint]
select = [
"I", # isort
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"N", # pep8-naming
"G", # flake8-logging-format
"PL", # Pylint (PLC, PLE, PLR, PLW)
"SLF001", # private-member-access
"BLE001", # blind-except
"B006", # mutable-argument-default
"B018", # useless-expression
"B023", # function-uses-loop-variable
"S", # flake8-bandit (security)
"TRY002", # raise-vanilla-class
"RUF", # ruff-specific rules
"PIE", # flake8-pie (misc. lints)
"PERF", # perflint (performance)
"RET", # flake8-return
"ASYNC", # flake8-async
"SIM", # flake8-simplify
# pydocstyle
"D101", # undocumented-public-class
# "D102", # undocumented-public-method
"D103", # undocumented-public-function
"D419", # empty-docstring
# pyupgrade
"UP006", # use dict/list instead of typing.Dict/List
"UP007", # use X | Y for unions
"UP032", # f-string
"UP037", # do not need quotes for type annotations
"UP045", # use X | None instead of Optional[X]
# disabled for now
# "B", # flake8-bugbear
# "PT009", # pytest-unittest-assertion
]
ignore = [
"E402", # module-import-not-at-top-of-file
"E501", # line-too-long - handled by formatter
"E721", # type-comparison
"E741", # ambiguous-variable-name
# pylint disabled rules
"PLC0415", # import-outside-toplevel
"PLR0904", # too-many-public-methods
"PLR0911", # too-many-return-statements
"PLR0912", # too-many-branches
"PLR0913", # too-many-arguments
"PLR0914", # too-many-locals
"PLR0915", # too-many-statements
"PLR0916", # too-many-boolean-expressions
"PLR0917", # too-many-positional-arguments
"PLR1702", # too-many-nested-blocks
"PLR6201", # using set literal for testing membership
"PLC2801", # unnecessary-dunder-call
"PLR5501", # collapsible-else-if
"PLC2401", # non-ascii-name
"PLC0207", # missing-maxsplit-arg
# Pylint optional checkers (not enabled by default in pylint)
"PLC2701", # import-private-name
"PLR2004", # magic-value-comparison
"PLR2044", # empty-comment
"PLR6301", # no-self-use
"PLW1641", # eq-without-hash
"PLW2901", # redefined-loop-name
"B019", # using lru_cache on methods can lead to memory leaks
"N802", # invalid-function-name
"N803", # invalid-argument-name
"N806", # non-lowercase-variable-in-function
"N813", # camelcase-imported-as-lowercase
"N815", # mixed-case-variable-in-class-scope
"N818", # error-suffix-on-exception-name
"F821", # undefined name
"F601", # multi-value-repeated-key-literal
"G010", # logging-warn
"G201", # logging-exc-info - use .exception() instead of .error() with exc_info=true
# bandit rules that are too noisy or not applicable in this codebase
"S101", # assert - legitimate use for invariants outside tests
"S104", # hardcoded-bind-all-interfaces - intentional in server code
"S105", # hardcoded-password-string - false positives on GCloud secret ID names
"S108", # hardcoded-temp-file - used in mock/test utilities
"S110", # try-except-pass - established pattern in the codebase
"S112", # try-except-continue - established pattern in the codebase
"S301", # suspicious-pickle-usage - used intentionally for serialization
"S311", # suspicious-non-cryptographic-random-usage - acceptable for ML/sampling
"S324", # hashlib-insecure-hash-function - used for checksums, not crypto
"S603", # subprocess-without-shell-equals-true - many legitimate uses
"S607", # start-process-with-partial-path - noisy on internal scripts
"S608", # hardcoded-sql-expression - internal query construction, not user input
# ruff-specific rules
"RUF001", # ambiguous-unicode-character-string
"RUF002", # ambiguous-unicode-character-docstring
"RUF003", # ambiguous-unicode-character-comment
"RUF005", # collection-literal-concatenation - [*a, *b] vs a + b is a style choice
"RUF009", # function-call-in-dataclass-default-argument - intentional pattern
"RUF012", # mutable-class-default - intentional in many classes
# flake8-simplify
"SIM102", # collapsible-if - often clearer as separate ifs
"SIM105", # suppressible-exception - contextlib.suppress not always clearer
"SIM108", # if-else-block-instead-of-if-exp - ternary not always more readable
"SIM117", # multiple-with-statements - combining withs can reduce readability
"SIM300", # yoda-conditions - established style in the codebase
# flake8-return
"RET504", # unnecessary-assign - named returns improve readability
# perflint
"PERF102", # incorrect-dict-iterator - unsafe for pandas DataFrame/Series (.values is a property)
"PERF203", # try-except-in-loop - auto-suppressed in monorepo (py311 target, zero-cost exceptions); SDK targets py310
"PERF401", # manual-list-comprehension - too many existing violations, fix incrementally
# flake8-async
"ASYNC109", # async-function-with-timeout - false positives on internal timeout patterns
]
[tool.ruff.lint.per-file-ignores]
"{**/test_*.py,**/*_test.py,**/tests/**/*.py,**/test/**/*.py}" = [
"F841", # unused-variable
"F811", # redefined-while-unused
"ARG001", # unused-function-argument
"ARG002", # unused-method-argument
"D", # pydocstyle
"S", # bandit - tests use hardcoded values, subprocess, etc.
"SLF001", # private-member-access
"RUF043", # pytest-raises-ambiguous-pattern
"RUF061", # legacy-form-pytest-raises
]
"**/__init__.py" = ["F401"] # unused-import
[tool.ruff.lint.isort]
known-first-party = ["exabel"]
detect-same-package = false
[tool.ruff.lint.pep8-naming]
extend-ignore-names = ["_*", "of*", "__*", "X*"]
[tool.ruff.lint.pydocstyle]
convention = "google"
ignore-decorators = ["typing.overload"]
ignore-var-parameters = true
[tool.ruff.lint.flake8-bandit]
check-typed-exception = true
[tool.ruff.lint.flake8-unused-arguments]
ignore-variadic-names = true