Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
105 lines (90 loc) · 2.94 KB
/
Copy pathpyproject.toml
File metadata and controls
105 lines (90 loc) · 2.94 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
[project]
name = "lfl-api"
version = "0.1.0"
description = "Learning Feedback Loop — operator-in-the-loop anomaly handling for CNC machining time-series"
requires-python = ">=3.9"
[tool.mypy]
# Python version (match the runtime environment)
python_version = "3.12"
# Paths to check
files = ["backend", "scripts", "tests"]
# `scripts/` is a namespace package (no __init__.py) but `scripts/legacy_migration/`
# has one, so mypy resolved that module under two names and aborted the whole run
# with "Source file found twice". Anchoring package names at the repo root makes
# the mapping unambiguous. Without this, mypy checks NOTHING and exits looking
# like a pass — see docs/TECH_DEBT_AND_REFACTOR_SCOPE_2026-08-04.md (DEBT-01).
explicit_package_bases = true
mypy_path = "."
exclude = [
"venv/",
".venv/",
"__pycache__/",
".*\\.pyi$",
"node_modules/",
]
# Strictness settings (lenient mode for gradual adoption)
# Phase 1: Basic checks only
warn_return_any = false # Too noisy with numpy
warn_unused_ignores = true
warn_redundant_casts = true
warn_unused_configs = true
# Allow untyped definitions (Phase 2: tighten these)
disallow_untyped_defs = false
disallow_incomplete_defs = false
check_untyped_defs = false # Disabled initially
# Handle missing imports gracefully
ignore_missing_imports = true
# Show error codes for easier suppression
show_error_codes = true
# Enable incremental mode for faster checks
incremental = true
cache_dir = ".mypy_cache"
# Disable noisy error categories for Phase 1
disable_error_code = [
"no-any-return", # Too noisy with numpy/scipy
"attr-defined", # Many false positives with optional imports
"var-annotated", # Can fix gradually
"call-arg", # Schema mismatch in store.py (needs refactoring)
"arg-type", # Schema mismatch in store.py (needs refactoring)
"name-defined", # Some forward refs and dynamic imports
"union-attr", # Optional faiss/sentence-transformers
]
# Pydantic plugin for better model support
plugins = ["pydantic.mypy"]
# Per-module overrides
[[tool.mypy.overrides]]
module = "tests.*"
# Tests can be less strict
disallow_untyped_defs = false
disable_error_code = ["var-annotated", "arg-type"]
[[tool.mypy.overrides]]
module = "scripts.*"
# Scripts can be less strict
disallow_untyped_defs = false
# Third-party library overrides (if needed)
[[tool.mypy.overrides]]
module = [
"faiss.*",
"sentence_transformers.*",
"river.*",
"plotly.*",
"torch.*",
]
ignore_missing_imports = true
[tool.pydantic-mypy]
# Pydantic mypy plugin configuration
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
[tool.pytest.ini_options]
# Move pytest config here too for consistency
testpaths = ["tests"]
pythonpath = ["."]
asyncio_mode = "auto"
python_files = ["test_*.py"]
python_functions = ["test_*"]
addopts = "-v --tb=short"
filterwarnings = [
"ignore::DeprecationWarning:pydantic.*:",
"ignore::DeprecationWarning:datetime.*:",
]