[build-system]
build-backend = "setuptools.build_meta"

requires = [
  "ninja",
  "setuptools",
  "torch>=2.7",
  "wheel",
]

[project]
name = "nunchaku"
requires-python = ">=3.10"

classifiers = [
  "Programming Language :: Python :: 3 :: Only",
  "Programming Language :: Python :: 3.10",
  "Programming Language :: Python :: 3.11",
  "Programming Language :: Python :: 3.12",
  "Programming Language :: Python :: 3.13",
]
dynamic = [ "version" ]
dependencies = [
  "accelerate>=1.9",
  "diffusers>=0.35.1",
  "einops",
  "huggingface-hub>=0.34",
  "peft>=0.17",
  "protobuf",
  "sentencepiece",
  "torchvision>=0.20",
  "transformers>=4.54,<4.57",
]
optional-dependencies.ci = [
  "accelerate==1.9",
  "controlnet-aux==0.0.10",
  "datasets==3.6",
  "diffusers @ git+https://github.com/huggingface/diffusers@041501a",
  "facexlib==0.3",
  "huggingface-hub==0.34",
  "image-gen-aux @ git+https://github.com/asomoza/image_gen_aux.git@e08ae3d",
  "insightface==0.7.3",
  "onnxruntime==1.22.1",
  "opencv-python==4.11.0.86",
  "peft==0.17",
  "pytest==8.4.2",
  "pytest-rerunfailures==16.0.1",
  "timm==1.0.19",
  "torchmetrics==1.8",
  "transformers==4.54",
]

optional-dependencies.demo = [
  "controlnet-aux",
  "gradio==5.39",
  "image-gen-aux @ git+https://github.com/asomoza/image_gen_aux.git",
  "spaces",
]
optional-dependencies.dev = [
  "controlnet-aux",
  "datasets<4",
  "facexlib",
  "image-gen-aux @ git+https://github.com/asomoza/image_gen_aux.git",
  "insightface",
  "onnxruntime",
  "opencv-python",
  "pre-commit",
  "pytest",
  "pytest-rerunfailures",
  "timm",
  "torchmetrics",
]
optional-dependencies.docs = [
  "breathe",
  "furo",
  "graphviz",
  "ipykernel",
  "jupyter",
  "myst-parser",
  "nbsphinx",
  "sphinx",
  "sphinx-book-theme",
  "sphinx-copybutton",
  "sphinx-rtd-theme",
  "sphinx-tabs",
  "sphinxawesome-theme",
  "sphinxcontrib-mermaid",
  "sphinxext-rediraffe",
]
optional-dependencies.full = [
  "controlnet-aux",
  "facexlib",
  "image-gen-aux @ git+https://github.com/asomoza/image_gen_aux.git",
  "insightface",
  "onnxruntime",
  "opencv-python",
  "timm",
]

[tool.setuptools.packages.find]
include = [ "nunchaku" ]

[tool.black]
line-length = 120
target-version = [ 'py311' ]

[tool.ruff]
line-length = 120

[tool.isort]
profile = "black"
known_first_party = [ "nunchaku" ]
line_length = 120

[tool.doc8]
max-line-length = 120
ignore-path = [ "docs/_build" ]
ignore = [ "D000", "D001" ]

[tool.rstcheck]
ignore_directives = [ "tabs" ]
ignore_messages = [ "ERROR/3", "INFO/1" ]
