[build-system]
requires = ["setuptools", "wheel", "pyyaml"]
build-backend = "setuptools.build_meta"

[project.scripts]
"lires" = "lires.exec:run"
"lrs-resetconf" = "lires.cmd.generateDefaultConf:run"
"lrs-utils" = "lires.cmd.miscUtils:main"
"lrs-clear" = "lires.cmd.clear:main"
"lrs-user" = "lires.cmd.userManage:run"
"lrs-index" = "lires.cmd.index:main"
"lrs-cluster" = "lires.cmd.cluster:main"

[project.urls]
"Homepage" = "https://github.com/MenxLi/Lires"
"Bug Tracker" = "https://github.com/MenxLi/Lires/issues"

[project]
name = "Lires"
authors = [
  { name="Li, Mengxun", email="mengxunli@whu.edu.cn" },
]
description = "A self-hosted literature management system."
readme = "README.md"
requires-python = ">=3.10"      # to support pep604 (structural pattern matching)
classifiers = [
    "Programming Language :: Python :: 3",
    "Operating System :: OS Independent",
    "Topic :: Scientific/Engineering :: Medical Science Apps."
]
dynamic = [
    "version",
]
license = { file = "LICENSE" }
dependencies = [
    # for successful import from basic lires packages,
    # such as lires.version, lires.config
    "typing_extensions",
    "pyyaml",
    "requests",
    "tiny_vectordb >= 0.1.7",
]

[project.optional-dependencies]
core = [
    "pybtex",
    "pylatexenc",
    "tornado",
    "aiohttp",
    "aiofiles",
    "PyMuPDF",
    "nbib",
    "tqdm",
    "pillow",
    "numpy",
    "scikit-learn",
]
ai = [
    "safetensors <= 0.3.2",     # 0.3.3 or higher seems requires rust installed
    "torch",
    "openai",
    "transformers",
    "fastapi[all]",
    "sentencepiece",
    "protobuf",
    "accelerate",
    "basaran",
]
all = ["Lires[core,ai]"]
dev = [
    "Lires[all]",
    "pytest",
    "pytest-html",
    "pytest-asyncio",
]