-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
221 lines (205 loc) · 7.43 KB
/
Copy pathpyproject.toml
File metadata and controls
221 lines (205 loc) · 7.43 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
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "nfl-predict"
version = "1.0.0"
description = "NFL Prediction System - Pre-game predictions for Win Probability, ATS, and O/U"
authors = [
{name = "Jack", email = "jack@example.com"},
]
readme = "README.md"
license = {text = "MIT"}
requires-python = ">=3.12"
keywords = ["nfl", "predictions", "sports-betting", "machine-learning"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dependencies = [
# Core data processing
"pandas>=2.2.0,<3",
"numpy>=1.26.0,<2",
"pyarrow>=18.0.0",
"duckdb>=1.5.0,<2",
# Modeling and ML
"scikit-learn>=1.8.0,<2",
"xgboost>=3.2.0,<4",
# API and Web UI
"fastapi>=0.115.0,<1",
"uvicorn[standard]>=0.34.0,<1",
"jinja2>=3.1.0,<4",
"pydantic>=2.10.0,<3",
"pydantic-settings>=2.7.0,<3",
"python-multipart>=0.0.18,<1",
"itsdangerous>=2.2.0,<3",
# HTTP requests and ETL
"httpx>=0.28.0,<1",
"tenacity>=9.0.0,<10",
"python-dateutil>=2.9.0,<3",
"tqdm>=4.67.0,<5",
# Data sources
"nflreadpy>=0.1.5,<1",
# Visualization for reports
"matplotlib>=3.10.0,<4",
"plotly>=6.0.0,<7",
# Utilities
"structlog>=24.4.0,<25",
"click>=8.1.0,<9",
"python-dotenv>=1.0.0,<2",
"joblib>=1.4.0,<2",
"pyyaml>=6.0.0,<7",
"jinja2-fragments>=1.11.0",
"optuna==4.8.0",
"cachetools>=7.0.5",
]
[dependency-groups]
dev = [
"ruff>=0.9.0",
"pyright>=1.1.390",
"pre-commit>=4.0.0",
"pytest>=8.3.0",
"pytest-cov>=6.0.0",
"pytest-asyncio>=0.25.0",
"hypothesis>=6.120.0",
"beautifulsoup4>=4.12.0",
]
[project.urls]
Homepage = "https://github.com/jackc/nfl-predict"
Repository = "https://github.com/jackc/nfl-predict"
Issues = "https://github.com/jackc/nfl-predict/issues"
[project.scripts]
nfl-predict = "scripts.friday_pipeline:main"
[tool.setuptools]
package-dir = {"" = "."}
[tool.setuptools.packages.find]
where = ["."]
include = ["scripts*", "ratings*", "models*", "backtest*", "api*"]
exclude = ["tests*", "data*", "outputs*", "artifacts*"]
# Ruff configuration
[tool.ruff]
target-version = "py312"
line-length = 88
fix = true
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort
"UP", # pyupgrade
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"SIM", # flake8-simplify
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"T20", # flake8-print
"RET", # flake8-return
"PTH", # flake8-use-pathlib
"ERA", # eradicate
"PL", # Pylint subset
"RUF", # Ruff-specific
]
ignore = [
"E501", # line too long (formatter handles)
"E402", # module-import-not-at-top -- common pattern in scripts/conditional imports
"PLR0913", # too many arguments
"PLR2004", # magic value comparison
"PLR0911", # too many return statements
"PLR0912", # too many branches
"PLR0915", # too many statements
"PLC0415", # import-outside-top-level -- common in existing code
"PLW0603", # global-statement -- existing patterns
"PLW1510", # subprocess-run-without-check
"PLW2901", # redefined-loop-name
"RET504", # unnecessary assignment before return
"RUF003", # ambiguous-unicode-character-comment
"RUF012", # mutable-class-default -- Pydantic models use this pattern
"RUF013", # implicit-optional -- TODO: fix incrementally
"RUF059", # unused-unpacked-variable
"DTZ001", # datetime-without-tzinfo -- TODO: fix incrementally
"DTZ005", # datetime-now-without-tzinfo -- TODO: fix incrementally
"DTZ006", # datetime-fromtimestamp -- TODO: fix incrementally
"PTH100", # os-path-abspath -- TODO: migrate to pathlib incrementally
"PTH103", # os-makedirs -- TODO: migrate to pathlib incrementally
"PTH108", # os-unlink -- TODO: migrate to pathlib incrementally
"PTH110", # os-path-exists -- TODO: migrate to pathlib incrementally
"PTH112", # os-path-isdir -- TODO: migrate to pathlib incrementally
"PTH118", # os-path-join -- TODO: migrate to pathlib incrementally
"PTH120", # os-path-dirname -- TODO: migrate to pathlib incrementally
"PTH123", # builtin-open -- TODO: migrate to pathlib incrementally
"PTH202", # os-path-getsize -- TODO: migrate to pathlib incrementally
"PTH208", # os-listdir -- TODO: migrate to pathlib incrementally
"SIM102", # collapsible-if -- style preference, low priority
"SIM108", # if-else-block-instead-of-if-exp -- style preference
"SIM117", # multiple-with-statements -- style preference
"B904", # raise-without-from-inside-except -- TODO: fix incrementally
"B905", # zip-without-explicit-strict -- TODO: fix incrementally
]
[tool.ruff.lint.flake8-bugbear]
# Allow FastAPI's Depends() in argument defaults (B008). The other FastAPI
# helpers (Query, Path, Body, Header, Cookie, File, Form, Security) are already
# in ruff's default immutable-calls list, but Depends is not.
extend-immutable-calls = ["fastapi.Depends"]
[tool.ruff.lint.per-file-ignores]
"scripts/*.py" = ["T201"]
"models/train.py" = ["T201"] # CLI entry point prints summary tables to stdout
"backtest/run.py" = ["T201"] # CLI entry point prints backtest summary to stdout
"backtest/tune.py" = ["T201"] # CLI entry point prints tuning summary to stdout
"backtest/group_gate.py" = ["T201"] # CLI entry point prints the Stage-1 9-cell grid to stdout
"scripts/generate_current_week_predictions.py" = ["BLE001"] # Operations script
"scripts/ingest_*.py" = ["BLE001"] # Ingestion scripts, fix incrementally
"scripts/load_venues.py" = ["BLE001"] # Utility script
"scripts/run_backtest.py" = ["BLE001"] # Runner script
"scripts/validate_*.py" = ["BLE001"] # Validation scripts
"data/storage.py" = ["BLE001"] # Pre-existing broad exception handlers, fix incrementally
"pipeline/health.py" = ["BLE001"] # Health checks must catch any exception and degrade gracefully
"pipeline/model_validation.py" = ["BLE001"] # Loadability check must catch any joblib.load failure and degrade gracefully
"deployment/**/*.py" = ["BLE001"] # Infrastructure scripts, not production code
"tests/**/*.py" = ["S101", "PLR2004", "BLE001"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
# Pyright configuration
[tool.pyright]
pythonVersion = "3.12"
typeCheckingMode = "standard"
reportMissingTypeStubs = false
reportUnknownMemberType = false
venvPath = "."
venv = ".venv"
# Pytest configuration
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = ["-v", "--tb=short"]
asyncio_mode = "auto"
markers = ["slow: marks tests as slow (deselect with '-m \"not slow\"')"]
# Coverage configuration
[tool.coverage.run]
source = ["scripts", "ratings", "models", "backtest", "api"]
omit = [
"*/tests/*",
"*/test_*.py",
"*/__init__.py",
"*/conftest.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]