[build-system]
requires = ["hatchling", "uv-dynamic-versioning"]
build-backend = "hatchling.build"

[tool.hatch.version]
source = "uv-dynamic-versioning"

[project]
name = "yomitoku"
dynamic = ["version"]
authors = [{name = "Kotaro Kinoshita", email = "kotaro.kinoshita@mlism.com"}]
description = "Yomitoku is an AI-powered document image analysis package designed specifically for the Japanese language."
readme = "README.md"
license = {text = "CC BY-NC-SA 4.0"}
requires-python = ">=3.10,<3.13"
keywords = ["Japanese", "OCR", "Deep Learning"]
dependencies = [
    "huggingface-hub>=0.26.1",
    "lxml>=5.3.0",
    "omegaconf>=2.3.0",
    "opencv-python>=4.10.0.84",
    "pyclipper>=1.3.0.post6",
    "pydantic>=2.9.2",
    "shapely>=2.0.6",
    "timm>=1.0.11",
    "torchvision>=0.20.0",
    "torch>=2.5.0",
    "pypdfium2>=4.30.0",
    "onnx>=1.17.0",
    "torch>=2.5.0",
    "torchvision>=0.20.0",
    "onnxruntime>=1.20.1",
]

[tool.uv-dynamic-versioning]
vcs = "git"
style = "semver"
format = "{base}"

[tool.uv]
dev-dependencies = [
    "mkdocs-codeinclude-plugin>=0.2.1",
    "mkdocs-material>=9.5.44",
    "mkdocs-static-i18n",
    "mkdocs>=1.6.1",
    "plantuml-markdown",
    "pygments",
    "pytest-cov>=5.0.0",
    "pytest>=8.3.3",
    "ruff>=0.7.0",
]

[tool.uv.sources]
torch = [
    { index = "pytorch-cpu", marker = "platform_system == 'Darwin'"},
]
torchvision = [
    { index = "pytorch-cpu", marker = "platform_system == 'Darwin'"},
]

[[tool.uv.index]]
name = "pytorch-cuda124"
url = "https://download.pytorch.org/whl/cu124"
explicit = true

[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true

[project.scripts]
yomitoku = "yomitoku.cli.main:main"

[tool.tox]
legacy_tox_ini = """
[tox]
envlist = lint, py310, py311, py312, docs

[testenv]
deps = pytest
commands = 
    pytest tests

[testenv:lint]
basepython = python3.12
deps = ruff
commands = 
    ruff check

[testenv:docs]
basepython = python3.12
deps = 
    mkdocs-material
    pygments 
    plantuml_markdown 
    mkdocs-static-i18n
    mkdocs-codeinclude-plugin
commands = 
    mkdocs gh-deploy --force
"""
