-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
125 lines (110 loc) · 2.93 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
[project]
name = "fastapi-boilerplate"
version = "0.1.0"
description = "FastAPI Boilerplate"
authors = [{ name = "Wang, Tao", email = "wangtao@cookding.com" }]
dependencies = [
"fastapi[standard]>=0.115.6",
"punq>=0.7.0",
"loguru>=0.7.3",
"prisma>=0.15.0",
]
requires-python = "==3.12.*"
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"
prisma-format = "prisma format"
prisma-generate = "prisma generate"
migrate-dev-create = "prisma migrate dev --create-only"
migrate-deploy = "prisma migrate deploy"
migrate-status = "prisma migrate status"
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" }
license-check = "licensecheck --zero"
[tool.pdm.dev-dependencies]
dev = [
"asgi-lifespan>=2.1.0",
"pytest>=8.3.4",
"pytest-cov>=6.0.0",
"ruff>=0.8.4",
"mypy>=1.14.0",
"anyio>=4.7.0",
"licensecheck>=2024.3",
]
[tool.prisma]
binary_cache_dir = '.venv/prisma-binaries'
[tool.mypy]
strict = true
follow_imports = "silent"
ignore_missing_imports = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
disallow_untyped_decorators = true
[[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 = "py312"
src = ["src"]
[tool.ruff.lint]
select = [
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"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 = [
"pragma: no cover",
"if __name__ == .__main__.:",
"@abstractmethod",
]
[tool.licensecheck]
using = "PEP631"