-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
141 lines (119 loc) · 3.54 KB
/
pyproject.toml
File metadata and controls
141 lines (119 loc) · 3.54 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
[project]
name = "async-sqlalchemy2-fastapi"
version = "0.1.0"
description = "Test project for async sqlalchemy and fastapi"
authors = [{ name = "Grant Ramsay (seapagan)", email = "seapagan@gmail.com" }]
license = "MIT"
readme = "README.md"
requires-python = ">=3.9"
dependencies = [
"asyncpg>=0.30.0",
"fastapi[standard]>=0.115.4",
"sqlalchemy[asyncio]>=2.0.36",
"uvicorn[standard]>=0.32.0",
"aiosqlite>=0.19.0",
]
[tool.uv]
dev-dependencies = [
"mypy>=1.8.0",
"pre-commit>=3.4.0",
"pymarkdownlnt>=0.9.14",
"ruff>=0.1.11",
"asyncpg-stubs>=0.29.1",
"github-changelog-md>=0.8.0",
"mkdocs>=1.4.3",
"mkdocs-material>=9.1.16",
"mkdocs-minify-plugin>=0.6.4",
"pymdown-extensions>=10.0.1",
"pygments>=2.15.1",
"poethepoet>=0.20.0",
]
[tool.poe.tasks]
# setup PoeThePoet tasks
serve = "uvicorn main:app --reload"
pre.cmd = "pre-commit run --all-files"
pre.help = "Run pre-commit checks"
mypy.cmd = "mypy . --strict"
mypy.help = "Run mypy checks"
format.help = "Format code with Ruff"
format.cmd = "ruff format ."
ruff.help = "Run Ruff checks"
ruff.cmd = "ruff check ."
markdown.cmd = "pymarkdown --strict-config scan -r docs/**/*.md"
markdown.help = "Run markdown checks"
# documentation tasks
"docs:publish".cmd = "mkdocs gh-deploy"
"docs:publish".help = "Publish documentation to GitHub Pages"
"docs:build".cmd = "mkdocs build"
"docs:build".help = "Build documentation locally to './site' folder"
"docs:serve".cmd = "mkdocs serve"
"docs:serve".help = "Serve documentation locally"
"docs:serve:all".cmd = "mkdocs serve"
"docs:serve:all".help = "Serve documentation locally on all interfaces"
# generate the CHANGELOG.md file
changelog.cmd = "github-changelog-md"
changelog.help = "Generate the CHANGELOG.md file"
[tool.pymarkdown]
plugins.md014.enabled = false
plugins.md046.enabled = false
plugins.md033.allowed_elements = "!--,![CDATA[,!DOCTYPE,swagger-ui"
plugins.md013.enabled = false
[tool.ruff]
line-length = 80
src = ["app"]
extend-exclude = [
"app/migrations", # auto-generated by alembic so we don't need to check them
]
target-version = "py39" # minimum python version supported
[tool.ruff.format]
indent-style = "space"
quote-style = "double"
[tool.ruff.lint]
select = ["ALL"] # we are being very strict!
extend-ignore = [
"COM812", # ignored for ruff formatting
"ISC001", # ignored for ruff formatting
"T201", # temporary ignore for now, will remove when migrate to logging
]
ignore = [
"PGH003",
"FBT002",
"FBT003",
"B006",
] # These rules are too strict even for us 😝
[tool.ruff.lint.pep8-naming]
classmethod-decorators = ["pydantic.validator", "pydantic.root_validator"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.extend-per-file-ignores]
"tests/**/*.py" = [
"S101", # we can (and MUST!) use 'assert' in test files.
"ANN001", # annotations for fixtures are sometimes a pain for test files.
"ARG001", # sometimes fixtures are not physically used but have side-effects
"ARG002", # as above
"TD003",
"FIX002",
"RUF012",
]
[tool.ruff.lint.flake8-bugbear]
extend-immutable-calls = [
"fastapi.Depends",
"fastapi.params.Depends",
"fastapi.Query",
"fastapi.params.Query",
]
[tool.ruff.lint.flake8-builtins]
builtins-ignorelist = ["id"]
[tool.ruff.lint.isort]
known-first-party = ["app"]
[tool.ruff.lint.pyupgrade]
keep-runtime-typing = true
[tool.mypy]
python_version = "3.9"
exclude = ["app/migrations/"]
[[tool.mypy.overrides]]
disable_error_code = ["method-assign", "no-untyped-def", "attr-defined"]
module = "tests.*"
[[tool.mypy.overrides]]
ignore_missing_imports = true
module = "decouple.*"