-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
155 lines (139 loc) · 4.61 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
[tool.poetry]
name = "sample-backend-app"
version = "0.1.0"
description = "A sample backend app used to illustrate development and testing techniques."
authors = ["Michal Bultrowicz <[email protected]>"]
license = "MIT"
readme = "README.md"
packages = [{include = "sample_backend"}]
[tool.poetry.dependencies]
python = "^3.12"
fastapi = "^0.115.4"
uvicorn = "^0.32.0"
sqlalchemy = "^2.0.36"
psycopg = {extras = ["binary"], version = "^3.2.3"}
tenacity = "^9.0.0"
pydantic-settings = "^2.6.1"
[tool.poetry.group.dev.dependencies]
pytest = "^8.3.3"
pdbpp = "^0.10.3"
coverage = "^7.6.4"
mypy = "^1.13.0"
ptpython = "^3.0.23"
alembic = "^1.14.0"
pytest-asyncio = "^0.21.0"
pgcli = "^4.1.0"
httpx = "^0.27.2"
pytest-xdist = "^3.6.1"
ruff = "^0.7.3"
pytest-mock = "^3.14.0"
[tool.mypy]
disallow_untyped_defs = true
# Config documentation: https://docs.astral.sh/ruff/settings/
[tool.ruff]
target-version = "py312"
line-length = 110
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
]
[tool.ruff.lint]
preview = false
# Docs for the rules: https://docs.astral.sh/ruff/rules/
# This should be almost all rules with some exception. Listed in the order from docs.
# Excluded checkers:
# - CPY - copyright
select = ["F", "E", "W",
"C90", "I", "N",
"D", "UP", "YTT",
"ANN", "ASYNC", "ASYNC1",
"S", "BLE", "FBT",
"B", "A", "COM",
"C4", "DTZ", "T10", "DJ",
"EM", "EXE", "ISC",
"ICN", "G", "INP",
"PIE", "T20", "PYI",
"PT", "Q", "RSE",
"RET", "SLF", "SLOT",
"SIM", "TID", "TCH",
"INT", "ARG", "PTH",
"TD", "FIX", "ERA",
"PD", "PGH", "PL",
"TRY", "FLY", "NPY",
"PERF", "FURB", "LOG",
"RUF",
]
ignore = [
"TD002", "TD003", "TD004", "TD007", # Ignore errors for specific todos in code
"S101", # Ignore asserts errors since cannot set for tests and would require for each project and tests specific pyproject configuration
"ANN101", # MyPy is checking that part
"ANN401", # If needed used deliberately
"PT001", # Use fixtures without brackets if they have no arguments
"B008", # FastAPI requires this for its dependency injection
"COM812", # Ignoring, we don't want commas at the end if it is last element
"D100", # allow missing docstring in public module
"D101", # allow missing docstring in public class
"D102", # allow missing docstring in public methods
"D103", # allow missing docstring in public function
"D104", # allow missing docstring in public package
"D107", # allow missing docstring in __init__
"D203", # choosing no blank line before docstrings on classes
"D212", # choosing a line break at beginning of docstrings
"D417", # not all arguments need documentation
"EM101", # String literals when raising Exceptions are OK
"FBT001", # boolean function arguments can be OK
"FBT002", # boolean function arguments defaults can be OK
"FIX002", # TODOs in code are acceptable
"G004", # f-strings in logs are OK, really
"PT023", # We want to be able to call pytest mark without parenthesis
"ISC001", # ruff is suggesting that this can conflict with the formatter
"TRY003", # It's fine to use string messages when raising exceptions like ValueError
]
fixable = ["ALL"]
unfixable = []
# TODO set that to the standard logger object when there's one
# https://docs.astral.sh/ruff/settings/#lint_logger-objects
# logger-objects = []
[tool.ruff.lint.pydocstyle]
# Google style of docstrings.
convention = "google"
[tool.ruff.lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
[tool.ruff.lint.isort]
force-sort-within-sections = true
[tool.ruff.format]
docstring-code-format = true
[tool.pytest.ini_options]
asyncio_mode = "auto"
markers = [
# Tests that are integrated with an external resource, most likely a Docker container running in Docker Compose.
"integrated",
# Tests that communicate with the code running in the Docker container "from the outside", using external (HTTP) interfaces.
"external",
# Tests that wouldn't play well with others if we run tests in parallel with xdist.
# That may be because they're destructive to the data, containers, or some other shared resource.
"non_parallel",
]
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"