-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
173 lines (158 loc) · 4.06 KB
/
Copy pathpyproject.toml
File metadata and controls
173 lines (158 loc) · 4.06 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
[project]
name = "shipping-forecast"
version = "0.1.0"
description = "End-to-end shipping demand forecasting system for LATAM e-commerce"
readme = "README.md"
requires-python = ">=3.11,<3.12"
authors = [
{ name = "Julio Pradenas" }
]
license = { text = "MIT" }
keywords = ["forecasting", "machine-learning", "time-series", "logistics", "mlops"]
dependencies = [
# Core data
"pandas>=2.2.0",
"numpy>=1.26.0",
"pyarrow>=15.0.0",
# SQL
"sqlalchemy>=2.0.0",
# ML core
"scikit-learn>=1.4.0",
"lightgbm>=4.3.0",
# Time series classics
"statsmodels>=0.14.0",
"prophet>=1.1.5",
# Hyperparameter tuning
"optuna>=3.5.0",
# Holidays / calendar
"holidays>=0.45",
# Experiment tracking
"mlflow>=2.11.0",
# Explainability
"shap>=0.45.0",
"numba>=0.59.0",
"llvmlite>=0.42.0",
# Visualization
"matplotlib>=3.8.0",
"seaborn>=0.13.0",
"plotly>=5.20.0",
"streamlit>=1.35.0",
# Config
"pydantic>=2.6.0",
"pydantic-settings>=2.2.0",
# Logging
"structlog>=24.1.0",
# Serialization
"joblib>=1.3.0",
]
[project.optional-dependencies]
dev = [
"pytest>=8.0.0",
"pytest-cov>=4.1.0",
"pytest-mock>=3.12.0",
"httpx>=0.27.0",
"ruff>=0.3.0",
"mypy>=1.9.0",
"pre-commit>=3.6.0",
"ipykernel>=6.29.0",
"jupyter>=1.0.0",
"types-requests",
"pandas-stubs",
"kaggle>=1.6.0",
]
api = [
"fastapi>=0.110.0",
"uvicorn[standard]>=0.27.0",
]
app = [
"streamlit>=1.32.0",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/shipping_forecast"]
# ======================
# Ruff (linter + formatter)
# ======================
[tool.ruff]
line-length = 100
target-version = "py311"
src = ["src", "tests"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort (import sorting)
"B", # flake8-bugbear (bug catches)
"C4", # flake8-comprehensions
"UP", # pyupgrade (modern Python idioms)
"N", # pep8-naming
"SIM", # flake8-simplify
"RUF", # ruff-specific rules
]
ignore = [
"E501", # line too long (formatter handles it)
]
[tool.ruff.lint.per-file-ignores]
"streamlit_app.py" = ["RUF001"]
# ML convention: X_train, X_test (uppercase X for feature matrices, lowercase y for targets).
# We allow N806 in modules that legitimately use this convention.
"tests/*" = ["N802", "N803", "N806"]
"src/shipping_forecast/models/*" = ["N806"]
"notebooks/*" = ["E402", "F401"] # notebooks have flexible imports
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
# ======================
# Mypy (type checker)
# ======================
[tool.mypy]
python_version = "3.11"
strict = false
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = false # gradual typing, no exigimos 100% al inicio
ignore_missing_imports = true # muchas libs ML no tienen stubs
files = ["src", "tests"]
# ======================
# Pytest
# ======================
[tool.pytest.ini_options]
minversion = "8.0"
addopts = [
"-ra", # show extra summary for all except passed
"--strict-markers", # error on undefined markers
"--strict-config",
"--cov", # error on unknown config keys
"--cov-report=term-missing", # mostrar líneas no cubiertas
"--cov-report=html", # generar reporte HTML
]
testpaths = ["tests"]
pythonpath = ["src"]
markers = [
"slow: tests that take more than 1s",
"integration: integration tests requiring external resources",
]
# ======================
# Coverage
# ======================
[tool.coverage.run]
source = ["src/shipping_forecast"]
branch = true
omit = [
"*/tests/*",
]
[tool.coverage.paths]
source = [
"src/shipping_forecast",
".venv/lib/python*/site-packages/shipping_forecast",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]