forked from ch-iv/litestar-manage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
322 lines (297 loc) · 9.43 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
[project]
name = "litestar-manage"
version = "0.1.0"
description = "Project scaffolding tool for Litestar"
authors = [
{name = "ch-iv", email = "[email protected]"},
]
dependencies = [
"ruff>=0.5.4",
"Jinja2>=3.1.4",
"rich-click>=1.8.3",
"litestar[cryptography,standard]>=2.10.0",
]
requires-python = ">=3.8"
readme = "README.md"
license = {text = "MIT"}
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
[project.scripts]
litestar = "litestar_manage.__main__:run_cli"
[tool.black]
exclude = '''
/(
\.git
| \.mypy_cache
| \.tox
| venv
| \.venv
| _build
| buck-out
| build
| dist
)/
'''
include = '\.pyi?$'
line-length = 120
[tool.coverage.report]
exclude_lines = [
'if TYPE_CHECKING:',
'pragma: no cover',
"if __name__ == .__main__.:",
'def __repr__',
'if self\.debug:',
'if settings\.DEBUG',
'raise AssertionError',
'raise NotImplementedError',
'if 0:',
'class .*\bProtocol\):',
'@(abc\.)?abstractmethod',
]
omit = ["*/tests/*", "*/litestar_manage/template/*"]
show_missing = true
[tool.coverage.run]
branch = true
omit = ["tests/*", "*/litestar_manage/template/*"]
[tool.pytest.ini_options]
addopts = ["-ra", "--ignore", "migrations"]
# env_files = [".env.testing"]
# env_override_existing_values = 1
filterwarnings = [
"ignore::DeprecationWarning:pkg_resources",
"ignore::DeprecationWarning:google.*",
"ignore::DeprecationWarning:passlib.*",
"ignore::DeprecationWarning:aiosql.*",
"ignore::DeprecationWarning:litestar.constants.*",
"ignore::DeprecationWarning:litestar.utils.*",
"ignore::DeprecationWarning:litestar.cli.*",
"ignore::DeprecationWarning:httpx._client",
]
testpaths = ["tests"]
[tool.ruff]
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
'__pycache__',
]
fix = true
line-length = 120
lint.fixable = ["ALL"]
lint.ignore = [
"E501", # pycodestyle line too long, handled by black
"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
"UP037", # pyupgrade - removes quotes from type annotation
"A003", # flake8-builtins - class attribute {name} is shadowing a python builtin
"B010", # flake8-bugbear - do not call setattr with a constant attribute value
"B008", # flake8-bugbear - Do not perform function call `Parameter` in argument defaultsRuff(B008)
"RUF012", # ruff - mutable class attributes should be annotated with `typing.ClassVar`
"ANN401", # ruff - Dynamically typed expressions (typing.Any) are disallowed
"ANN102",
"ANN101", # ruff - Missing type annotation for `self` in method
"PLR0913", # ruff - Too many arguments to function call
"PLR2004", # Magic value used in comparison
"FBT001", # Boolean typed positional argument in function definition
"FBT002", # Boolean default positional argument in function definition
"FBT003", # Boolean Boolean default positional argument in function definition
"ARG002", # Unused method argument
"ARG001", # Unused function argument
"TD002",
"TD003",
"FIX002",
"PGH003",
"RUF006",
"SLF001",
"PT007",
'PT004',
'PT005',
'S603',
"E501", # pycodestyle line too long, handled by black
"PLW2901", # pylint - for loop variable overwritten by assignment target
"ANN401",
"ANN102",
"ANN101",
"FBT",
"PLR0913", # too many arguments
"PT",
"TD",
"PERF203", # ignore for now; investigate
"COM812",
"ISC001"
]
lint.select = ["ALL"]
# Allow unused variables when underscore-prefixed.
lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
src = ["src", "tests/"]
target-version = "py311"
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.mccabe]
max-complexity = 12
[tool.ruff.lint.pep8-naming]
classmethod-decorators = [
"classmethod",
]
[tool.ruff.lint.isort]
known-first-party = ['tests', 'litestar_manage']
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ['F401', 'D104']
"tests/*.py" = ['D103', 'S101', 'D104']
[tool.slotscheck]
strict-imports = false
[tool.codespell]
ignore-words-list = "alog"
skip = 'pdm.lock, package-lock.json'
[tool.mypy]
disallow_any_generics = false
disallow_incomplete_defs = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
exclude = '''(?x)(
^build/
|^dist/
|^.venv/
|^node_modules/
|^src/litestar_manage/template/
)
'''
implicit_reexport = false
plugins = []
strict = true
warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
mypy_path = "src/litestar_manage/stubs/"
[[tool.mypy.overrides]]
disallow_untyped_decorators = false
module = ["tests.*"]
[[tool.mypy.overrides]]
disallow_untyped_calls = false
disallow_untyped_decorators = false
module = ["aisoql.*"]
[[tool.mypy.overrides]]
ignore_missing_imports = true
module = [
"sqlalchemy.*",
"saq.*",
"uvicorn.*",
"aiohttp.*",
"jsbeautifier",
"jsbeautifier.*",
"uvloop",
"uvloop.*",
"nodeenv",
]
[[tool.mypy.overrides]]
ignore_errors = true
module = ["app.db.migrations.*", "app.lib.dto.*"]
[tool.pyright]
exclude = ["src/litestar_manage/template"]
include = ["src/litestar_manage", "tests"]
[tool.git-cliff.changelog]
body = """
{% if version %}\
`Release [v{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} <https://github.com/litestar-org/litestar-fullstack/releases/tag/v{{ version | trim_start_matches(pat="v") }}>`_
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* `See All commits in v{{ version | trim_start_matches(pat="v") }} <https://github.com/litestar-org/litestar-fullstack/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/litestar-org/litestar-fullstack/commit/{{ previous.commit_id }}>`_ ... \
`{{ previous.commit_id | truncate(length=7, end="") }} <https://github.com/litestar-org/litestar-fullstack/commit/{{ commit_id }}>`_ \
| `See diff for {{ version }} <https://github.com/litestar-org/litestar-fullstack/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/litestar-org/litestar-fullstack/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 = """
Litestar Fullstack 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
[tool.pdm]
distribution = true
[tool.pdm.dev-dependencies]
dev = [
"litestar[standard,cryptography,jinja]>=2.9.1",
]
lint = [
"pyright>=1.1.376",
"mypy>=1.11.1",
"pre-commit>=3.5.0",
"types-click>=7.1.8",
]
test = [
"pytest>=8.3.2",
"pytest-cov>=5.0.0",
"testfixtures>=8.3.0",
]