infoxtractor/pyproject.toml
Dirk Riemann 2e8ca0ee43
All checks were successful
tests / test (push) Successful in 1m43s
tests / test (pull_request) Successful in 1m21s
feat(ui): add browser UI at /ui for job submission
Minimal Jinja2 + HTMX + Pico CSS UI (all CDN, no build step) that lets
a user drop a PDF, pick a registered use case or define one inline,
tweak OCR/GenAI/provenance options, submit, and watch the pretty-JSON
result come back via 2s HTMX polling. Uploads land in
{tmp_dir}/ui/<uuid>.pdf via aiofiles streaming with the existing
IX_FILE_MAX_BYTES cap.

All submissions go through the same jobs_repo.insert_pending entry
point the REST adapter uses — no duplicated logic. The REST surface is
unchanged.

Tests: tests/integration/test_ui_routes.py — 8 cases covering GET /ui,
registered + custom use-case submissions (asserting the stored request
carries use_case_inline for the custom path), malformed fields_json
rejection, and the fragment renderer for pending vs. done.

New deps pinned explicitly in pyproject.toml:
jinja2, aiofiles, python-multipart (arrive transitively via FastAPI but
we own the import surface now).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 21:27:54 +02:00

90 lines
2.4 KiB
TOML

[project]
name = "infoxtractor"
version = "0.1.0"
# Released 2026-04-18 with the first live deploy of the MVP. See
# docs/deployment.md §"First deploy" for the commit + /healthz times.
description = "Async on-prem LLM-powered structured information extraction microservice"
readme = "README.md"
requires-python = ">=3.12"
license = { text = "MIT" }
authors = [{ name = "goldstein" }]
dependencies = [
# Web / async
"fastapi>=0.115",
"uvicorn[standard]>=0.32",
"httpx>=0.27",
# Data
"pydantic>=2.9",
"pydantic-settings>=2.6",
# Database
"sqlalchemy[asyncio]>=2.0.36",
"asyncpg>=0.30",
"alembic>=1.14",
# Document processing
"pymupdf>=1.25",
"pillow>=10.2,<11.0",
"python-magic>=0.4.27",
"python-dateutil>=2.9",
# UI (HTMX + Jinja2 templates served from /ui). Both arrive as transitive
# deps via FastAPI/Starlette already, but we pin explicitly so the import
# surface is owned by us. python-multipart backs FastAPI's `Form()` /
# `UploadFile` parsing — required by `/ui/jobs` submissions.
"jinja2>=3.1",
"aiofiles>=24.1",
"python-multipart>=0.0.12",
]
[project.optional-dependencies]
ocr = [
# Real OCR engine. Kept optional so CI (no GPU) can install the base
# package without the model deps.
# surya >= 0.17 is required: the client code uses the
# `surya.foundation` module, which older releases don't expose.
"surya-ocr>=0.17,<0.18",
"torch>=2.7",
]
dev = [
"pytest>=8.3",
"pytest-asyncio>=0.24",
"pytest-httpx>=0.32",
"ruff>=0.8",
"mypy>=1.13",
]
# Note: the default pypi torch ships cu13 wheels, which emit a
# UserWarning and fall back to CPU against the deploy host's CUDA 12.4
# driver. Surya then runs on CPU — slower but correct for MVP. A future
# driver upgrade unlocks GPU Surya with no code changes.
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/ix"]
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
addopts = "-ra --strict-markers"
markers = [
"live: requires live Ollama/Surya (IX_TEST_OLLAMA=1 to enable)",
]
[tool.ruff]
line-length = 100
target-version = "py312"
[tool.ruff.lint]
select = ["E", "F", "W", "I", "UP", "B", "SIM", "RUF"]
ignore = ["E501"] # line length handled by formatter
[tool.mypy]
python_version = "3.12"
strict = true
plugins = ["pydantic.mypy"]