infoxtractor/pyproject.toml
Dirk Riemann d90117807b
All checks were successful
tests / test (push) Successful in 3m21s
tests / test (pull_request) Successful in 3m40s
fix(deps): pin torch to the CUDA 12.4 wheel channel
The default pypi torch (2.11 as of lockfile) ships cu13 wheels, which
refuse to initialise against the deploy host's NVIDIA 12.4 driver
(UserWarning: "driver on your system is too old (found version 12040)").
/healthz reported ocr: fail because Surya couldn't pick up the GPU.

Use `tool.uv.sources` to route torch through PyTorch's cu124 index.
That pulls torch 2.6.0+cu124 (still satisfies surya-ocr >= 0.9). Lock
updated. transformers downgraded to 4.57.6, triton to 3.2.0 — all
compatible with surya and each other.

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

86 lines
2 KiB
TOML

[project]
name = "infoxtractor"
version = "0.1.0"
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",
]
[project.optional-dependencies]
ocr = [
# Real OCR engine — pulls torch + CUDA wheels. Kept optional so CI
# (no GPU) can install the base package without the model deps.
"surya-ocr>=0.9",
# torch pinned to the cu124 wheel channel via tool.uv.sources below
# so the GPU wheels match the deploy host's CUDA 12.4 driver.
"torch>=2.4",
]
dev = [
"pytest>=8.3",
"pytest-asyncio>=0.24",
"pytest-httpx>=0.32",
"ruff>=0.8",
"mypy>=1.13",
]
# Make uv pull torch from the CUDA 12.4 wheel channel to match the
# deploy host's NVIDIA driver (server has CUDA 12.4; pypi torch 2.11
# ships cu13 wheels which refuse to initialise on an older driver).
[[tool.uv.index]]
name = "pytorch-cu124"
url = "https://download.pytorch.org/whl/cu124"
explicit = true
[tool.uv.sources]
torch = { index = "pytorch-cu124" }
[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"]