-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
116 lines (104 loc) · 3.75 KB
/
pyproject.toml
File metadata and controls
116 lines (104 loc) · 3.75 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
[project]
name = "fastapi-moscow-python-demo"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"alembic>=1.16.5",
"bandit>=1.8.6",
"fastapi>=0.116.1",
"flake8>=7.3.0",
"ipykernel>=6.30.1",
"jinja2>=3.1.6",
"matplotlib>=3.10.6",
"mypy>=1.17.1",
"numpy>=2.3.3",
"pandas>=2.3.2",
"passlib>=1.7.4",
"pydantic-settings>=2.10.1",
"pyjwt>=2.10.1",
"pytest>=8.4.2",
"radon>=6.0.1",
"ruff>=0.13.0",
"seaborn>=0.13.2",
"sqlalchemy>=2.0.43",
"sqlmodel>=0.0.24",
"tabulate>=0.9.0",
"tenacity>=9.1.2",
"types-passlib>=1.7.7.20250602",
"vulture>=2.14",
"wemake-python-styleguide>=1.4.0",
]
[tool.mypy]
# Core strictness
strict = true
extra_checks = true # opt-in stricter checks beyond --strict
warn_unreachable = true # not included in --strict; catch dead/ redundant code
implicit_reexport = false # require explicit re-exports (no implicit module exports)
local_partial_types = true # force annotations for top-level/class partial types
strict_equality = true # prohibit always-false/true comparisons
# Be ruthless about Any
disallow_any_unimported = true
disallow_any_decorated = true
disallow_any_explicit = true
disallow_any_generics = true
disallow_subclassing_any = true
# No untyped or half-typed defs/calls
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
# Hygiene & signal
warn_return_any = true
warn_redundant_casts = true
warn_unused_ignores = true
show_error_codes = true
# Optional error codes that make reviews sharper
enable_error_code = [
"ignore-without-code", # every `# type: ignore` must be specific
"redundant-expr", # flag obviously redundant boolean logic
"possibly-undefined", # variables not defined on all paths
"truthy-bool", # questionable truthiness checks
"truthy-iterable", # questionable truthiness checks on iterables
"deprecated", # use of @deprecated (PEP 702 / typing_extensions)
"exhaustive-match" # non-exhaustive `match` on enums / unions (where supported)
]
# Optional: make the default on recent mypy explicit (safer across versions)
implicit_optional = false
[[tool.mypy.overrides]]
module = ["emails.*"]
follow_untyped_imports = true
[tool.ruff]
target-version = "py313"
exclude = ["hooks", "frontend"]
[tool.ruff.lint]
select = ["ALL"]
external = ["WPS"]
ignore = [
"D104", # Ignore missing docstrings in packages
"COM812", # Allow f-strings with single curly braces
"D203", # 1 blank line required before class docstring (conflicts with D211)
"D212", # Multi-line docstring summary should start at the first line
"E501",
]
[tool.ruff.lint.extend-per-file-ignores]
"backend/app/tests/**/*.py" = [
# at least this three should be fine in tests:
"S101", # asserts allowed in tests...
"ARG", # Unused function args -> fixtures nevertheless are functionally relevant...
"FBT", # Don't care about booleans as positional arguments in tests, e.g. via @pytest.mark.parametrize()
# The below are debateable
"PLR2004", # Magic value used in comparison, ...
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
"D103", # Ignore missing docstrings in tests
"D100", # Ignore missing docstrings in public modules
]
"backend/app/models/__init__.py" = ["RUF022"]
"backend/app/alembic/**/*.py" = ["D103"]
[tool.bandit]
exclude_dirs = ["app/tests"]
[tool.vulture]
exclude = ["backend/app/alembic/"]
ignore_decorators = ["@router.get", "@router.post", "@router.put", "@router.delete", "@router.patch",
"@model_validator", "@field_validator"]
ignore_names = ["model_config", "return_value"]