-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
138 lines (123 loc) · 3.59 KB
/
pyproject.toml
File metadata and controls
138 lines (123 loc) · 3.59 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
[project]
name = "fastapi-boilerplate"
version = "0.1.0"
description = "FastAPI Boilerplate"
authors = [{ name = "Cook Ding Developers", email = "developer@cookding.com" }]
dependencies = [
"alembic>=1.18.4",
"asyncpg==0.30.0",
"cryptography==46.0.3",
"fastapi[standard]==0.127.0",
"loguru==0.7.3",
"punq==0.7.0",
"pyjwt==2.10.1",
"qs-codec==1.3.2",
"SQLAlchemy>=2.0.49",
"sentry-sdk[fastapi]==2.48.0",
]
requires-python = "==3.13.*"
readme = "README.md"
license = { text = "MIT" }
[tool.pdm]
distribution = false
[tool.pdm.scripts]
lint = { shell = """\
set -ex
mypy src
ruff check src tests scripts --fix
ruff format src tests scripts
""" }
db-up = "bash scripts/db-up.sh"
db-down = "bash scripts/db-down.sh"
migrate-dev-create.cmd = "alembic revision --autogenerate"
migrate-dev-create.env = { PYTHONPATH = "./src/" }
migrate-deploy.cmd = "alembic upgrade head"
migrate-deploy.env = { PYTHONPATH = "./src/" }
migrate-status.cmd = "alembic heads"
migrate-status.env = { PYTHONPATH = "./src/" }
dev.cmd = "uvicorn src.app.main:app --host=${APP_HOST} --port=${APP_PORT} --log-level=${LOG_LEVEL} --reload"
dev.env = { PYTHONPATH = "./src/" }
dev.env_file = ".env"
start.cmd = "python -m src.app.main"
start.env = { PYTHONPATH = "./src/" }
test.cmd = "pytest -r A"
test.env = { LOG_LEVEL = "error" }
test-cov.cmd = "pytest --cov-config=.coveragerc --verbosity=3 --cov=src/app --cov-branch --cov-report term-missing tests/"
test-cov.env = { LOG_LEVEL = "error" }
test-only.cmd = "pytest -r A -m only"
test-only.env = { LOG_LEVEL = "error" }
license-check = "licensecheck --zero"
[tool.pdm.dev-dependencies]
dev = [
"anyio==4.12.0",
"asgi-lifespan==2.1.0",
"licensecheck==2025.1.0",
"mypy==1.19.1",
"pytest-cov==7.0.0",
"pytest==9.0.2",
"ruff==0.14.10",
]
[tool.mypy]
strict = true
follow_imports = "silent"
ignore_missing_imports = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
disallow_untyped_decorators = true
enable_error_code = "explicit-override"
[[tool.mypy.overrides]]
module = "src.*"
warn_unused_ignores = false
[[tool.mypy.overrides]]
module = "tests.*"
check_untyped_defs = true
[tool.ruff]
line-length = 88
indent-width = 4
exclude = ["tests/fixtures"]
target-version = "py313"
src = ["src"]
[tool.ruff.lint]
select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"F401", # unused-import
"FAST001", # fast-api-redundant-response-model
"FAST002", # fast-api-non-annotated-dependency
"FAST003", # fast-api-unused-path-parameter
"I", # isort
"PGH", # pygrep-hooks
"RUF", # ruff
"TID", # flake8-tidy-imports
"W", # pycodestyle
"YTT", # flake8-2020
]
ignore = [
"B008", # function-call-in-default-argument
"B018", # useless-expression
"B019", # cached-instance-method
"RUF018", # assignment-in-assert
]
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.lint.isort]
known-first-party = ["pdm"]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.pytest.ini_options]
pythonpath = ["src"]
filterwarnings = ["ignore::DeprecationWarning"]
addopts = ["--import-mode=importlib", "--strict-config", "--strict-markers"]
xfail_strict = true
junit_family = "xunit2"
testpaths = ["tests/"]
markers = ["only"]
[tool.coverage.report]
exclude_lines = [
"@abstractmethod",
"if __name__ == .__main__.:",
"pragma: no cover",
]
[tool.licensecheck]
using = "PEP631"
format = "simple"