[project]
name = "pocket-tts"
requires-python = ">= 3.10,<3.15"
description = "Kyutai's pocket-sized text-to-speech!"
version = "2.1.0"
readme = "README.md"
dependencies = [
    "numpy>=2",
    # I tried 2.4.0 but the generated audio is wrong, so 2.5+ is needed.
    "torch>=2.5.0",
    "pydantic>=2",
    "sentencepiece>=0.2.1",
    "beartype>=0.22.5",
    "safetensors>=0.4.0",
    "typer>=0.10.0",
    "typing_extensions>=4.0.0",
    "fastapi>=0.100",
    "uvicorn>=0.13.0",
    "python-multipart>=0.0.21",
    "scipy>=1.5.0",
    "einops>=0.4.0",
    "huggingface_hub>=0.13.0",
    "requests>=2.20.0",
]

[project.optional-dependencies]
audio = ["soundfile>=0.12.0"]
quantize = ["torchao>=0.16.0"]


[dependency-groups]
dev = [
    "coverage>=7.6.12",
    "line-profiler>=5.0.0",
    "mkdocs>=1.6.1",
    "mkdocs-autolinks-plugin>=0.7.1",
    "mkdocs-material>=9.7.1",
    "mkdocstrings-python>=2.0.1",
    "pytest>=9.0.2",
    "pytest-xdist>=3.8.0",
    "soundfile",
]


[tool.uv.sources]
torch = [
    { index = "pytorch-cpu" },
]

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

[tool.ruff]
line-length = 100

[tool.ruff.format]
line-ending = "lf"
# avoid having a trailing comma changing 
# the behavior of the formatter
skip-magic-trailing-comma = true

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["pocket_tts"]

[project.scripts]
pocket-tts = "pocket_tts.main:cli_app"

[tool.uv]
# System python distribution can have header files missing, so we use only the python
# distributions provided by uv which have everything included.
python-preference = "only-managed"

[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
