Ports the leaf data-layer modules and validates them: - mschema/ (models, eligibility, merge, render), db/ (connection, sampling, introspect, fetch_ca), rest/client.py -- renamed psdwp3->nsp, verbatim. - L0 (testcontainers, real Postgres): db connection read-only enforcement (psd_ro cannot CREATE/INSERT), introspect against a known schema (tables, columns, types, comments, FKs, enum, composite PK), sampling most-frequent values + truncation reporting. 15 tests, ~4s. - L1 (fake data): rest/client RPC contract (mocked transport -- X-API-Key header, payloads, base_url slash handling, HTTP/network error surfacing), mschema/render 3 formats (markdown, mschema-text, schema-dict) + eligibility rules (wide_text excluded, short_text/numeric/enum/temporal/ boolean eligible, annotation override wins). 25 tests. pyproject registers l0/l2 markers + addopts '-m not l2' (L2 opt-in). Deferred to their dependency-porting tasks: test_rrf.py (search needs vectorstore, B3) and the 11 CLI contract tests (need _guards/session, wired when each command lands). 'Not assumed reliable' now has real teeth for the data layer; CLI/search contracts follow.
40 lines
882 B
TOML
40 lines
882 B
TOML
[project]
|
|
name = "nsp"
|
|
version = "0.1.0"
|
|
description = "ThothII harness — deterministic CLI for the NL→SQL workflow"
|
|
requires-python = ">=3.12"
|
|
dependencies = [
|
|
"typer>=0.12",
|
|
"pydantic>=2.0",
|
|
"pyyaml>=6.0",
|
|
"sqlalchemy>=2.0",
|
|
"psycopg2-binary>=2.9",
|
|
"datasketch>=1.6",
|
|
"sqlglot>=23.0",
|
|
"python-dotenv>=1.0",
|
|
"rich>=13.0",
|
|
"requests>=2.31",
|
|
"tqdm>=4.66",
|
|
]
|
|
|
|
[project.scripts]
|
|
nsp = "nsp.cli:app"
|
|
|
|
[project.optional-dependencies]
|
|
dev = [
|
|
"pytest>=8.0",
|
|
"testcontainers[postgres]>=4.0",
|
|
"ruff>=0.5",
|
|
]
|
|
|
|
[tool.ruff]
|
|
line-length = 100
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|
|
markers = [
|
|
"l0: testcontainers tests (need Docker, run locally)",
|
|
"l2: end-to-end tests requiring real GLM 5.2 + remote DB (skipped when .env incomplete)",
|
|
]
|
|
addopts = "-m 'not l2'" # L0 runs by default (Docker present); L2 opt-in
|