-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
143 lines (134 loc) · 6.32 KB
/
Copy pathpyproject.toml
File metadata and controls
143 lines (134 loc) · 6.32 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
[build-system]
requires = ["setuptools>=68", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "ootils-core"
version = "0.1.0"
description = "The first supply chain decision engine designed for the age of AI agents"
readme = "README.md"
requires-python = ">=3.11"
license = { text = "MIT" }
authors = [{ name = "ngoineau" }]
keywords = ["supply-chain", "decision-engine", "ai-agents", "inventory", "procurement"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Office/Business",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
# Compatible-release pins (PEP 440 `~=`): allow minor + patch updates, block
# the next major. Dependabot opens PRs weekly to bump within these ranges.
# See docs/REVIEW-2026-05.md R4.
dependencies = [
"fastapi ~= 0.128.0", # NOT ~= 0.128: that means <1.0 and let CI resolve 0.139 + starlette 1.x (breaking)
"uvicorn[standard] ~= 0.40",
"psycopg[binary] ~= 3.3",
"psycopg-pool ~= 3.3",
"pydantic ~= 2.12",
"openai ~= 2.15",
"slowapi ~= 0.1",
# Prometheus metrics for /metrics (#392 AN-2). Run dependency, not an extra:
# the request middleware records counters/histograms unconditionally.
"prometheus-client ~= 0.21",
# Staging file parsers (ADR-013): TSV/CSV via stdlib csv, XLSX via openpyxl.
"openpyxl ~= 3.1",
"python-multipart ~= 0.0.20", # FastAPI file uploads (multipart/form-data)
# gRPC client to the Rust propagation engine (src/ootils_core/engine_rust_service).
# client.py / generated _grpc stubs import grpc + protobuf at module level;
# stubs are generated with protobuf 6.31, so pin the 6.x runtime.
"grpcio ~= 1.71",
"protobuf >= 6.31,< 8.0",
# L3 outbound webhook (notifications/l3_webhook.py): the human-in-the-loop
# ping must work in a LEAN watcher install, not only under [dev] — a core
# runtime dependency by design (PROD-QW review finding).
"httpx ~= 0.28",
# GET /ui shell (EXP-1 PR1, ADR-036): Jinja2Templates renders the human
# window's static HTML shell — autoescape is ON by default in starlette's
# Jinja2Templates. A core runtime dependency, not an extra: the router is
# always importable even when OOTILS_UI_ENABLED=0 (the kill switch gates
# registration at create_app() time, not the import).
"jinja2 ~= 3.1",
# Feed-contract YAML registry (INT-1 PR1, ADR-037):
# interfaces/contracts.py parses config/feed-contracts/*.yaml via
# yaml.safe_load ONLY (pilot-edited config, never executed as code). Core
# runtime dependency, not an extra: the loader CLI is meant to run in any
# lean install.
"PyYAML ~= 6.0",
]
[project.optional-dependencies]
# hypothesis powers the property-based exactness net (moteur-c1 C1): the pure
# calculation cores (descent shares, DRP fair-share, MRP core, reschedule
# dampening, projection kernel) are checked against invariants, not just fixed
# goldens. Deterministic in CI via the 'ci' Hypothesis profile (derandomize),
# registered in tests/conftest_hypothesis.py.
dev = ["pytest ~= 9.0", "pytest-cov ~= 7.1", "hypothesis ~= 6.0"]
forecast = [
"statsforecast ~= 2.0",
"mlforecast ~= 1.0",
"lightgbm ~= 4.0",
"pandas ~= 2.3",
# Optional MinT-shrink reconciliation backend (Pyramide axis A, PR3).
# Lazy-imported by pyramide/hierarchy/reconcile.py with a fallback to
# the deterministic middle-out path when absent (ADR-022).
"hierarchicalforecast ~= 1.0",
]
foundation = [
# Chronos-2 foundation-model backend (Pyramide axis B, PR-B2) — kept a
# SEPARATE extra because it is HEAVY: torch alone is hundreds of MB and
# the model weights (~ hundreds of MB more) are pulled from HuggingFace
# on first load (pre-download them for offline VMs — see the
# pyramide/foundation.py docstring: HF_HOME / HF_HUB_OFFLINE).
# Lazy-imported by pyramide/foundation.py; when absent, FM_CHRONOS
# falls back to the deterministic AUTO_SELECT path (or fails loudly
# under strict_backend). CPU inference is enough for the demo scale;
# install the CPU-only torch wheel (--index-url
# https://download.pytorch.org/whl/cpu) to avoid the CUDA payload.
"chronos-forecasting ~= 2.0", # Chronos-2 support (Apache-2.0)
"torch ~= 2.6",
]
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools.package-data]
"ootils_core" = ["db/migrations/*.sql", "api/ui/templates/*.html", "api/ui/static/*.js"]
[tool.ruff]
# Generated gRPC/protobuf stubs are not hand-maintained — never lint them
# (E402 module-import-order, F401 unused re-exports are inherent to protoc output).
extend-exclude = ["src/ootils_core/_grpc"]
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-v"
markers = [
"slow: marks tests as slow (deselect with '-m not slow')",
"smoke: marks tests as smoke tests",
"critical: marks tests as critical path",
"requires_db: marks tests that require a live DB connection",
"live_db: tests that need a real Postgres + ootils-engine binary (engine_service battery)",
"foundation: tests that REQUIRE the [foundation] extra + downloaded Chronos weights (dedicated CI job only; auto-skip when chronos is not importable)",
"invariants_exempt: a test that DELIBERATELY commits a pre-fix / invariant-violating state (chantier moteur-d'exception CHANTIER 1); the autouse invariant_violations net (tests/integration/conftest.py) downgrades its module's teardown assertion to a logged, dated exemption instead of a hard fail. Requires a reason=... kwarg.",
]
[tool.coverage.run]
source = ["src/ootils_core"]
branch = true
omit = [
"src/ootils_core/demo/*", # demo scripts — covered by e2e tests, not unit
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
]
[tool.mypy]
# Permissive baseline — every module should pass today's checks. We intentionally
# do NOT enable strict mode yet because the codebase has untyped boundaries
# (psycopg row dicts, dynamic SQL helpers). Tighten one rule at a time.
python_version = "3.11"
ignore_missing_imports = true
warn_unused_ignores = true
warn_redundant_casts = true
no_implicit_optional = true