-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpyproject.toml
365 lines (333 loc) · 9.94 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
[project]
authors = [{ name = "Cody Fincher", email = "cody@litestar.dev" }]
dependencies = ["typing-extensions", "sqlglot", "eval_type_backport; python_version < \"3.10\""]
description = "SQL Experiments in Python"
license = "MIT"
maintainers = [{ name = "Litestar Developers", email = "hello@litestar.dev" }]
name = "sqlspec"
readme = "README.md"
requires-python = ">=3.9, <4.0"
version = "0.10.1"
[project.optional-dependencies]
adbc = ["adbc_driver_manager", "pyarrow"]
aioodbc = ["aioodbc"]
aiosqlite = ["aiosqlite"]
asyncmy = ["asyncmy"]
asyncpg = ["asyncpg"]
bigquery = ["google-cloud-bigquery"]
duckdb = ["duckdb"]
fastapi = ["fastapi"]
flask = ["flask"]
litestar = ["litestar"]
msgspec = ["msgspec"]
nanoid = ["fastnanoid>=0.4.1"]
oracledb = ["oracledb"]
orjson = ["orjson"]
performance = ["sqlglot[rs]", "msgspec"]
psqlpy = ["psqlpy"]
psycopg = ["psycopg[binary,pool]"]
pydantic = ["pydantic", "pydantic-extra-types"]
pymssql = ["pymssql"]
pymysql = ["pymysql"]
spanner = ["google-cloud-spanner"]
uuid = ["uuid-utils>=0.6.1"]
[dependency-groups]
build = ["bump-my-version"]
dev = [
{ include-group = "extras" },
{ include-group = "lint" },
{ include-group = "doc" },
{ include-group = "test" },
{ include-group = "build" },
]
doc = [
"auto-pytabs[sphinx]>=0.5.0",
"shibuya",
"sphinx>=7.0.0; python_version <= \"3.9\"",
"sphinx>=8.0.0; python_version >= \"3.10\"",
"sphinx-autobuild>=2021.3.14",
"sphinx-copybutton>=0.5.2",
"sphinx-click>=6.0.0",
"sphinx-design>=0.5.0",
"sphinxcontrib-mermaid>=0.9.2",
"sphinx-paramlinks>=0.6.0",
"sphinx-togglebutton>=0.3.2",
"sphinx-toolbox>=3.8.1",
"myst-parser",
"sphinx-autodoc-typehints",
]
extras = [
"adbc_driver_manager",
"pyarrow",
"polars",
"adbc_driver_sqlite",
"adbc_driver_postgresql",
"adbc_driver_flightsql",
"adbc_driver_bigquery",
]
lint = [
"mypy>=1.13.0",
"pre-commit>=3.5.0",
"pyright>=1.1.386",
"ruff>=0.7.1",
"slotscheck>=0.16.5",
"types-Pygments",
"types-colorama",
"asyncpg-stubs",
]
test = [
"anyio",
"coverage>=7.6.1",
"pytest>=8.0.0",
"pytest-asyncio>=0.23.8",
"pytest-cov>=5.0.0",
"pytest-databases[postgres,oracle,mysql,bigquery,spanner]>=0.12.2",
"pytest-mock>=3.14.0",
"pytest-sugar>=1.0.0",
"pytest-xdist>=3.6.1",
]
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]
[tool.hatch.build.targets.sdist]
dev-mode-dirs = ["."]
exclude = ["/.github", "/docs"]
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
include = ["NOTICE"]
packages = ["sqlspec"]
[tool.bumpversion]
allow_dirty = true
commit = false
commit_args = "--no-verify"
current_version = "0.10.1"
ignore_missing_files = false
ignore_missing_version = false
message = "chore(release): bump to v{new_version}"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
regex = false
replace = "{new_version}"
search = "{current_version}"
serialize = ["{major}.{minor}.{patch}"]
sign_tags = false
tag = false
tag_message = "chore(release): v{new_version}"
tag_name = "v{new_version}"
[[tool.bumpversion.files]]
filename = "pyproject.toml"
replace = 'version = "{new_version}"'
search = 'version = "{current_version}"'
[[tool.bumpversion.files]]
filename = "uv.lock"
replace = """
name = "sqlspec"
version = "{new_version}"
"""
search = """
name = "sqlspec"
version = "{current_version}"
"""
[tool.codespell]
ignore-words-list = "te"
skip = 'uv.lock'
[tool.coverage.run]
branch = true
concurrency = ["multiprocessing"]
disable_warnings = ["no-data-collected", "module-not-measured", "module-not-imported"]
omit = ["*/tests/*"]
parallel = true
plugins = ["covdefaults"]
relative_files = true
source = ["sqlspec"]
[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
# Don't complain about missing debug-only code:
"def __repr__",
"if self\\.debug",
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
# Don't complain if non-runnable code isn't run:
"if 0:",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
'class .*\bProtocol\):',
'@(abc\.)?abstractmethod',
]
[tool.pytest.ini_options]
addopts = ["-q", "-ra"]
asyncio_default_fixture_loop_scope = "function"
asyncio_mode = "auto"
filterwarnings = [
"ignore::DeprecationWarning:pkg_resources.*",
"ignore:pkg_resources is deprecated as an API:DeprecationWarning",
"ignore::DeprecationWarning:pkg_resources",
"ignore::DeprecationWarning:google.rpc",
"ignore::DeprecationWarning:google.gcloud",
"ignore::DeprecationWarning:google.iam",
"ignore::DeprecationWarning:google",
"ignore::DeprecationWarning:websockets.connection",
"ignore::DeprecationWarning:websockets.legacy",
]
markers = [
"integration: marks tests that require an external database",
"postgres: marks tests specific to PostgreSQL",
"duckdb: marks tests specific to DuckDB",
"sqlite: marks tests specific to SQLite",
"bigquery: marks tests specific to Google BigQuery",
"mysql: marks tests specific to MySQL",
"oracle: marks tests specific to Oracle",
"spanner: marks tests specific to Google Cloud Spanner",
"mssql: marks tests specific to Microsoft SQL Server",
# Driver markers
"adbc: marks tests using ADBC drivers",
"aioodbc: marks tests using aioodbc",
"aiosqlite: marks tests using aiosqlite",
"asyncmy: marks tests using asyncmy",
"asyncpg: marks tests using asyncpg",
"duckdb_driver: marks tests using the duckdb driver",
"google_bigquery: marks tests using google-cloud-bigquery",
"google_spanner: marks tests using google-cloud-spanner",
"oracledb: marks tests using oracledb",
"psycopg: marks tests using psycopg",
"pymssql: marks tests using pymssql",
"pymysql: marks tests using pymysql",
"psqlpy: marks tests using psqlpy",
]
testpaths = ["tests"]
[tool.mypy]
packages = ["sqlspec", "tests"]
python_version = "3.9"
disallow_any_generics = false
disallow_untyped_decorators = true
enable_error_code = "ignore-without-code"
implicit_reexport = false
show_error_codes = true
strict = true
warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
[[tool.mypy.overrides]]
ignore_missing_imports = true
module = [
"orjson",
"re2",
"re2.*",
"uvicorn.*",
"googleapiclient",
"googleapiclient.*",
"uvloop.*",
"asyncmy",
"asyncmy.*",
"pyarrow",
"pyarrow.*",
]
[tool.pyright]
disableBytesTypePromotions = true
exclude = ["**/node_modules", "**/__pycache__", ".venv", "tools", "docs"]
include = ["sqlspec", "tests"]
pythonVersion = "3.9"
reportMissingTypeStubs = false
reportPrivateImportUsage = false
reportPrivateUsage = false
reportUnknownArgumentType = false
reportUnknownMemberType = false
reportUnknownVariableType = false
reportUnnecessaryTypeIgnoreComments = true
root = "."
[tool.slotscheck]
strict-imports = false
[tool.ruff]
exclude = [".venv", "node_modules"]
line-length = 120
src = ["sqlspec", "tests", "docs/examples", "tools"]
target-version = "py39"
[tool.ruff.format]
docstring-code-format = true
docstring-code-line-length = 60
[tool.ruff.lint]
extend-safe-fixes = ["TC"]
fixable = ["ALL"]
ignore = [
"A003", # flake8-builtins - class attribute {name} is shadowing a python builtin
"B010", # flake8-bugbear - do not call setattr with a constant attribute value
"D100", # pydocstyle - missing docstring in public module
"D101", # pydocstyle - missing docstring in public class
"D102", # pydocstyle - missing docstring in public method
"D103", # pydocstyle - missing docstring in public function
"D104", # pydocstyle - missing docstring in public package
"D105", # pydocstyle - missing docstring in magic method
"D106", # pydocstyle - missing docstring in public nested class
"D107", # pydocstyle - missing docstring in __init__
"D202", # pydocstyle - no blank lines allowed after function docstring
"D205", # pydocstyle - 1 blank line required between summary line and description
"D415", # pydocstyle - first line should end with a period, question mark, or exclamation point
"E501", # pycodestyle line too long, handled by ruff format
"PLW2901", # pylint - for loop variable overwritten by assignment target
"RUF012", # Ruff-specific rule - annotated with classvar
"ISC001", # Ruff formatter incompatible
"A005", # flake8 - Module `x` shadows a Python standard-library module
"PLC0415", # pylint - `import` should be at the top of the file
"FA100", # Add `from __future__ import annotations` to simplify
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"FBT001", # Boolean-typed positional argument in function definition
"FBT002", # Boolean default positional argument in function definition
"PLR0913", # pylint - Too many arguments in function definition
"ARG002", # Unused method argument
"ARG001", # Unused function argument
"CPY001", # pycodestyle - Missing Copywrite notice at the top of the file
"RUF029", # Ruff - function is declared as async but has no awaitable calls
"COM812", # flake8-comma - Missing trailing comma
"PGH003", # Use Specific ignore for pyright
]
select = ["ALL"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.mccabe]
max-complexity = 18
[tool.ruff.lint.pep8-naming]
classmethod-decorators = ["classmethod"]
[tool.ruff.lint.isort]
known-first-party = ["sqlspec", "tests"]
[tool.ruff.lint.per-file-ignores]
"docs/**/*.*" = ["S", "B", "DTZ", "A", "TC", "ERA", "D", "RET", "PLW0127"]
"docs/examples/**" = ["T201"]
"tests/**/*.*" = [
"A",
"ARG",
"B",
"BLE",
"C901",
"D",
"DTZ",
"EM",
"FBT",
"G",
"N",
"PGH",
"PIE",
"PLR",
"PLW",
"PTH",
"RSE",
"S",
"S101",
"SIM",
"TC",
"TRY",
"PT012",
"INP001",
"DOC",
"PLC",
]
"tools/**/*.*" = ["D", "ARG", "EM", "TRY", "G", "FBT", "S603", "F811", "PLW0127", "PLR0911"]
"tools/prepare_release.py" = ["S603", "S607"]
[tool.ruff.lint.flake8-tidy-imports]
# Disallow all relative imports.
ban-relative-imports = "all"