forked from litestar-org/advanced-alchemy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
405 lines (377 loc) · 13.2 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
[project]
authors = [
{name = "Cody Fincher", email = "[email protected]"},
{name = "Peter Schutt", email = "[email protected]"},
{name = "Janek Nouvertné", email = "[email protected]"},
{name = "Jacob Coffee", email = "[email protected]"},
]
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Web Environment",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"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",
"Programming Language :: Python",
"Topic :: Software Development",
"Typing :: Typed",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Topic :: Database",
"Topic :: Database :: Database Engines/Servers",
]
dependencies = [
"sqlalchemy>=2.0.20",
"alembic>=1.12.0",
"typing-extensions>=4.0.0",
"greenlet; sys_platform == \"darwin\"",
]
description = "Ready-to-go SQLAlchemy concoctions."
keywords = ["sqlalchemy", "alembic", "litestar", "sanic", "fastapi", "flask"]
license = {text = "MIT"}
name = "advanced_alchemy"
readme = "README.md"
requires-python = ">=3.8"
version = "0.6.1"
[project.urls]
Changelog = "https://docs.advanced-alchemy.jolt.rs/latest/changelog"
Discord = "https://discord.gg/XpFNTjjtTK"
Documentation = "https://docs.advanced-alchemy.jolt.rs/latest/"
Funding = "https://github.com/sponsors/jolt-org"
Homepage = "https://docs.advanced-alchemy.jolt.rs/latest/"
Issue = "https://github.com/jolt-org/advanced-alchemy/issues/"
Source = "https://github.com/jolt-org/advanced-alchemy"
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]
[tool.pdm.dev-dependencies]
dev = [
"asyncmy>=0.2.8",
"asyncpg>=0.28.0",
"oracledb>=1.4.0",
"redis>=5.0.0",
"duckdb-engine>=0.9.2",
"aiosqlite>=0.19.0",
"psycopg[pool,binary]>=3.1.10",
"psycopg2-binary",
"pytest-xdist>=3.3.1",
"sqlalchemy-spanner>=1.6.2",
"sqlalchemy-cockroachdb>=2.0.0",
"litestar>=2.0.1",
"fastapi>=0.103.1",
"msgspec>=0.18.2",
"orjson>=3.9.7",
"pyodbc>=4.0.39",
"duckdb>=0.9.0",
"asgi-lifespan>=2.1.0",
"aioodbc>=0.5.0",
]
docs = [
"sphinx>=7.1.2",
"sphinx-autobuild>=2021.3.14",
"sphinx-copybutton>=0.5.2",
"shibuya>=2023.9.3",
"sphinx-click>=5.0.1",
"sphinx-toolbox>=3.5.0",
"blacken-docs>=1.16.0",
"sphinx-design>=0.5.0",
]
extensions = [
"litestar[cli]>=2.0.0",
"fastapi>=0.101.0",
"sanic[ext]>=23.6.0",
"sanic-testing>=23.6.0",
"socketify>=0.0.27",
"msgspec>=0.18.2",
"flask>=3.0.0",
"flask-sqlalchemy>=3.1.1",
]
linting = [
"pre-commit>=3.4.0",
"black>=23.7.0",
"mypy>=1.5.1",
"ruff>=0.0.287",
"asyncpg-stubs",
"types-pytest-lazy-fixture",
"types-click",
"types-pyyaml",
]
test = [
"pytest>=7.4.1",
"pytest-xdist>=3.3.1",
"anyio<4.0.0",
"pytest-lazy-fixture>=0.6.3",
"pytest-asyncio>=0.21.1",
"pytest-mock>=3.11.1",
"time-machine>=2.12.0",
"httpx>=0.24.1",
"pytz",
"coverage",
"pytest-cov",
]
[tool.pytest.ini_options]
addopts = ["--dist", "loadgroup", "-n", "auto"]
asyncio_mode = "auto"
markers = [
"integration: SQLAlchemy integration tests",
"asyncmy: SQLAlchemy MySQL (asyncmy) Tests",
"asyncpg: SQLAlchemy Postgres (asyncpg) Tests",
"psycopg_async: SQLAlchemy Postgres (psycopg async) Tests",
"psycopg_sync: SQLAlchemy Postgres (psycopg sync) Tests",
"aiosqlite: SQLAlchemy SQLite (aiosqlite) Tests",
"sqlite: SQLAlchemy SQLite (sqlite) Tests",
"oracledb: SQLAlchemy Oracle (oracledb) Tests",
"spanner: SQLAlchemy Google Cloud Spanner (sqlalchemy-spanner) Tests",
"duckdb: SQLAlchemy DuckDB (duckdb-engine) Tests",
"mssql_sync: SQLAlchemy Microsoft SQL Server (pyodbc) Tests",
"mssql_async: SQLAlchemy Microsoft SQL Server (aioodbc) Tests",
"mock_async: SQLAlchemy async mock Tests",
"mock_sync: SQLAlchemy sync mock Tests",
"cockroachdb_sync: SQLAlchemy CockroachDB (psycopg2) Tests",
"cockroachdb_async: SQLAlchemy CockroachDB (asyncpg) Tests",
]
filterwarnings = [
"ignore::DeprecationWarning:pkg_resources.*",
"ignore::DeprecationWarning:google.rpc",
"ignore::DeprecationWarning:google.gcloud",
"ignore::DeprecationWarning:google.iam",
"ignore::DeprecationWarning:google",
]
[tool.coverage.run]
concurrency = ["multiprocessing", "thread"]
omit = [
"*/tests/*",
"advanced_alchemy/alembic/templates/asyncio/env.py",
"advanced_alchemy/alembic/templates/sync/env.py",
"advanced_alchemy/extensions/litestar/cli.py",
"advanced_alchemy/alembic/commands.py",
"advanced_alchemy/types.py",
"advanced_alchemy/operations.py",
"advanced_alchemy/service/*",
]
parallel = true
[tool.coverage.report]
exclude_lines = [
'pragma: no cover',
'if TYPE_CHECKING:',
'except ImportError as e:',
'except ImportError:',
'\.\.\.',
'raise NotImplementedError',
'if VERSION.startswith("1"):',
'if pydantic.VERSION.startswith("1"):',
]
[tool.black]
line-length = 120
[tool.ruff]
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 black
"PLW2901", # pylint - for loop variable overwritten by assignment target
"RUF012", # Ruff-specific rule - annotated with classvar
"ANN401",
"ANN102",
"ANN101",
"FBT",
"PLR0913", # too many arguments
"PT",
"TD",
"ARG002", # ignore for now; investigate
"PERF203", # ignore for now; investigate
"PD011", # pandas
]
line-length = 120
select = ["ALL"]
src = ["advanced_alchemy", "tests"]
target-version = "py38"
[tool.ruff.pydocstyle]
convention = "google"
[tool.ruff.mccabe]
max-complexity = 12
[tool.ruff.pep8-naming]
classmethod-decorators = [
"sqlalchemy.ext.declarative.declared_attr",
"sqlalchemy.orm.declared_attr.directive",
"sqlalchemy.orm.declared_attr",
]
[tool.ruff.per-file-ignores]
"advanced_alchemy/repository/*.py" = ['PLR0912', 'C901']
"tests/**/*.*" = [
"A",
"ARG",
"B",
"BLE",
"C901",
"D",
"DTZ",
"EM",
"FBT",
"G",
"N",
"PGH",
"PIE",
"PLR",
"PLW",
"PTH",
"RSE",
"S",
"S101",
"SIM",
"TCH",
"TRY",
"UP006",
"SLF001",
]
[tool.ruff.isort]
known-first-party = ["advanced_alchemy", "tests"]
[tool.mypy]
disallow_any_generics = false
disallow_untyped_decorators = true
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]]
disable_error_code = "attr-defined"
disallow_untyped_decorators = false
module = "tests.*"
warn_unused_ignores = false
[[tool.mypy.overrides]]
ignore_missing_imports = true
module = [
"asyncmy",
"pyodbc",
"google.auth.*",
"google.cloud.*",
"google.protobuf.*",
"pyarrow.*",
"pytest_docker.*",
"googleapiclient",
"googleapiclient.*",
]
[[tool.mypy.overrides]]
disallow_untyped_decorators = false
module = "advanced_alchemy.extensions.litestar.cli"
[[tool.mypy.overrides]]
module = "advanced_alchemy.alembic.templates.*.env"
warn_unreachable = false
[[tool.mypy.overrides]]
disable_error_code = "no-untyped-call"
disallow_untyped_decorators = false
module = "advanced_alchemy.extensions.sanic"
warn_unused_ignores = false
[tool.unasyncd]
add_editors_note = true
cache = false
ruff_fix = true
update_docstrings = true
[tool.unasyncd.files]
"advanced_alchemy/repository/_async.py" = "advanced_alchemy/repository/_sync.py"
"advanced_alchemy/repository/memory/_async.py" = "advanced_alchemy/repository/memory/_sync.py"
"advanced_alchemy/service/_async.py" = "advanced_alchemy/service/_sync.py"
[tool.unasyncd.per_file_add_replacements."advanced_alchemy/repository/_async.py"]
SQLAlchemyAsyncMockRepository = "SQLAlchemySyncMockRepository"
SQLAlchemyAsyncRepository = "SQLAlchemySyncRepository"
"async_scoped_session" = "scoped_session"
"sqlalchemy.ext.asyncio.AsyncSession" = "sqlalchemy.orm.Session"
"sqlalchemy.ext.asyncio.scoping.async_scoped_session" = "sqlalchemy.orm.scoping.scoped_session"
[tool.unasyncd.per_file_add_replacements."advanced_alchemy/repository/memory/_async.py"]
SQLAlchemyAsyncMockRepository = "SQLAlchemySyncMockRepository"
SQLAlchemyAsyncRepository = "SQLAlchemySyncRepository"
"async_scoped_session" = "scoped_session"
"sqlalchemy.ext.asyncio.AsyncSession" = "sqlalchemy.orm.Session"
"sqlalchemy.ext.asyncio.scoping.async_scoped_session" = "sqlalchemy.orm.scoping.scoped_session"
[tool.unasyncd.per_file_add_replacements."advanced_alchemy/service/_async.py"]
SQLAlchemyAsyncMockRepository = "SQLAlchemySyncMockRepository"
SQLAlchemyAsyncRepository = "SQLAlchemySyncRepository"
SQLAlchemyAsyncRepositoryReadService = "SQLAlchemySyncRepositoryReadService"
SQLAlchemyAsyncRepositoryService = "SQLAlchemySyncRepositoryService"
"advanced_alchemy.repository.SQLAlchemyAsyncMockRepository" = "advanced_alchemy.repository.SQLAlchemySyncMockRepository"
"advanced_alchemy.repository.SQLAlchemyAsyncRepository" = "advanced_alchemy.repository.SQLAlchemySyncRepository"
"async_scoped_session" = "scoped_session"
"sqlalchemy.ext.asyncio.AsyncSession" = "sqlalchemy.orm.Session"
"sqlalchemy.ext.asyncio.scoping.async_scoped_session" = "sqlalchemy.orm.scoping.scoped_session"
[tool.codespell]
ignore-words-list = "selectin"
skip = 'pdm.lock, examples/us_state_lookup.json'
[tool.git-cliff.changelog]
body = """
{% if version %}\
`Release [v{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} <https://github.com/jolt-org/advanced-alchemy/releases/tag/v{{ version | trim_start_matches(pat="v") }}>`_
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* `See All commits in v{{ version | trim_start_matches(pat="v") }} <https://github.com/jolt-org/advanced-alchemy/commits/v{{ version | trim_start_matches(pat="v") }}>`_
{% else %}\
[unreleased]
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
{% endif %}\
{% if previous %}\
{% if previous.commit_id %}
`{{ previous.commit_id | truncate(length=7, end="") }} <https://github.com/jolt-org/advanced-alchemy/commit/{{ previous.commit_id }}>`_ ... \
`{{ commit_id | truncate(length=7, end="") }} <https://github.com/jolt-org/advanced-alchemy/commit/{{ commit_id }}>`_ \
| `See diff for {{ version | trim_start_matches(pat="v") }} <https://github.com/jolt-org/advanced-alchemy/compare/{{ previous.commit_id }}...{{ commit_id }}>`_
{% endif %}\
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
{{ group | upper_first }}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
{% for commit in commits %}
* (`{{ commit.id | truncate(length=7, end="") }} <https://github.com/jolt-org/advanced-alchemy/commit/{{ commit.id }}>`_) {% if commit.breaking %}[**breaking**] {% endif %} - {{ commit.message | upper_first }} ({{ commit.author.name }})\
{% for footer in commit.footers -%}
, {{ footer.token }}{{ footer.separator }}{{ footer.value }}\
{% endfor %}\
{% endfor %}
{% endfor %}\n
"""
footer = """
Advanced Alchemy Changelog
"""
header = """
=========
Changelog
=========\n
All commits to this project will be documented in this file.\n
"""
trim = true
[tool.git-cliff.git]
commit_parsers = [
{message = "^feat", group = "Features"},
{message = "^fix", group = "Bug Fixes"},
{message = "^doc", group = "Documentation"},
{message = "^perf", group = "Performance"},
{message = "^refactor", group = "Refactor"},
{message = "^style", group = "Styling"},
{message = "^test", group = "Testing"},
{message = "^chore\\(release\\): prepare for", skip = true},
{message = "^chore", group = "Miscellaneous Tasks"},
{body = ".*security", group = "Security"},
]
conventional_commits = true
filter_commits = false
filter_unconventional = true
ignore_tags = ""
protect_breaking_commits = false
skip_tags = "v0.1.0-beta.1"
sort_commits = "oldest"
split_commits = false
tag_pattern = "v[0-9]*"
topo_order = false