-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
115 lines (102 loc) · 3.19 KB
/
pyproject.toml
File metadata and controls
115 lines (102 loc) · 3.19 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
[tool.ruff]
# Keep it simple and fast; respect existing style while catching common issues.
line-length = 100
# Limit to our source tree
src = ["webapp"]
exclude = [
"webapp/static",
"webapp/templates",
"webapp/__pycache__",
"**/__pycache__",
]
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
"I", # isort (import sorting only for new files)
]
ignore = [
"E501", # long lines are common in logging/doc payloads
"E402", # allow late imports where refactors would be large (temporary)
]
[tool.ruff.lint.per-file-ignores]
"webapp/parser/handlers/formats/pdf_handler.py" = ["E402", "F401", "I001", "E741", "F841"]
[tool.mypy]
python_version = "3.12"
warn_unused_ignores = true
warn_redundant_casts = true
warn_unreachable = true
no_implicit_optional = true
check_untyped_defs = false
ignore_missing_imports = true
follow_imports = "silent"
# Only attempt to type-check our source tree; many third-party libs are optional at runtime.
files = ["webapp"]
exclude = [
"webapp/static",
"webapp/templates",
"webapp/__pycache__",
# Example scaffold has a space in the folder name, which breaks module discovery for mypy
"webapp/parser/handlers/states/example state/.*",
]
# Gradual typing: ignore errors across the app by default, then opt-in for critical modules.
[[tool.mypy.overrides]]
module = ["webapp.*"]
ignore_errors = true
# Enforce on format handlers (our ingestion parity surface)
[[tool.mypy.overrides]]
module = ["webapp.parser.handlers.formats.*"]
ignore_errors = false
check_untyped_defs = true
no_implicit_optional = true
# Temporarily relax pdf handler; it's large and being incrementally typed
[[tool.mypy.overrides]]
module = ["webapp.parser.handlers.formats.pdf_handler"]
ignore_errors = true
[tool.pytest.ini_options]
minversion = "7.0"
testpaths = ["webapp/tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = "-p no:unraisableexception -p no:seleniumbase -ra --strict-markers --tb=short"
filterwarnings = [
"ignore:Importing 'parser.split_arg_string' is deprecated, it will only be available in 'shell_completion' in Click 9.0.:DeprecationWarning"
]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests requiring external resources",
"live_integration: marks optional live-pathway tests (enable explicitly)",
"unit: marks pure unit tests",
]
[tool.coverage.run]
source = ["webapp/parser"]
omit = [
"*/tests/*",
"*/migrations/*",
"*/__pycache__/*",
]
[tool.coverage.report]
precision = 2
show_missing = true
skip_covered = false
# Enforce on tests to keep examples/types honest
[[tool.mypy.overrides]]
module = ["webapp.tests.*"]
ignore_errors = false
check_untyped_defs = true
[tool.setuptools.optional-dependencies]
# Install with: `pip install .[selenium]`
selenium = [
"seleniumbase>=4.40.8",
]
dev = [
"prometheus-client>=0.16.0",
]
[tool.poe.tasks]
run-tests = { cmd = "./scripts/run_tests.sh" }
run-tests-win = { cmd = "pwsh ./scripts/run_tests.ps1" }
smoke = { cmd = "./scripts/run_pipeline_smoke.sh" }
ci-verify = { cmd = "./scripts/ci_verify.sh" }
run-webapp = { cmd = "./scripts/run_webapp.sh" }
run-webapp-win = { cmd = "pwsh ./scripts/run_webapp.ps1" }