[build-system]
requires = ["setuptools>=69", "setuptools-scm>=8", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "mi-crow"
readme = "README.md"
description = "Engineer Thesis: Explaining and modifying LLM responses using SAE and concepts."
authors = [
    { name = "Hubert Kowalski", email = "your.email@example.com" },
    { name = "Adam Kaniasty", email = "adam.kaniasty@gmail.com" }
]
requires-python = ">=3.10"
dependencies = [
    "accelerate>=1.10.1",
    "datasets>=4.0.0",
    "notebook>=7.4.7",
    "overcomplete",
    "pre-commit>=4.3.0",
    "setuptools-scm>=8",
    "torch>=2.8.0",
    "tqdm>=4.67.1",
    "transformers>=4.56.1",
    "safetensors>=0.4.5",
    "wandb>=0.22.1",
    "pytest>=8.4.2",
    "pytest-xdist>=3.8.0",
    "seaborn>=0.13.2",
]
dynamic = ["version"]

[project.optional-dependencies]
dev = [
    "pre-commit>=4.3.0",
    "ruff>=0.13.2",
    "setuptools-scm>=8",
    "wheel>=0.45.1",
    "pytest>=8.0.0",
    "pytest-cov>=5.0.0",
]
docs = [
  "mkdocs>=1.6",
  "mkdocs-material>=9.5",
  "mkdocstrings[python]>=0.26",
  "mkdocs-section-index>=0.3",
  "mkdocs-redirects>=1.2",
  "mkdocs-literate-nav>=0.6",
  "mkdocs-gen-files>=0.5",
  "mike>=2.1",
]

[tool.pytest.ini_options]
addopts = "--maxfail=1 -q --cov=mi_crow --cov-report=term-missing --cov-report=xml --cov-fail-under=85"
testpaths = ["tests"]
pythonpath = ["src"]

[tool.coverage.run]
branch = true
source = ["mi_crow"]
parallel = true

[tool.coverage.report]
show_missing = true
skip_covered = true
fail_under = 85

[tool.coverage.xml]
output = "coverage.xml"

[tool.coverage.html]
directory = "htmlcov"

[tool.setuptools.packages.find]
where = ["src"]
include = ["mi_crow*"]
exclude = ["server*", "frontend*"]

[tool.setuptools_scm]
fallback_version = "0.0.0"
version_scheme = "post-release"
local_scheme = "no-local-version"  # Required for PyPI (local versions not allowed)

[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
    ".bzr",
    ".direnv",
    ".eggs",
    ".git",
    ".git-rewrite",
    ".hg",
    ".ipynb_checkpoints",
    ".mypy_cache",
    ".nox",
    ".pants.d",
    ".pyenv",
    ".pytest_cache",
    ".pytype",
    ".ruff_cache",
    ".svn",
    ".tox",
    ".venv",
    ".vscode",
    "__pypackages__",
    "_build",
    "buck-out",
    "build",
    "dist",
    "node_modules",
    "site-packages",
    "venv",
]
line-length = 120
indent-width = 4
target-version = "py310"

[tool.ruff.lint]
select = ["E", "F", "I", "W", "C"]
ignore = []
fixable = ["ALL"]
unfixable = []
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
docstring-code-format = false
docstring-code-line-length = "dynamic"

[dependency-groups]
dev = [
    "pre-commit>=4.3.0",
    "ruff>=0.13.2",
    "setuptools-scm>=8",
    "wheel>=0.45.1",
    "pytest>=8.0.0",
    "pytest-cov>=7.0.0",
]
server = [
    "fastapi>=0.124.4",
    "httpx>=0.28.1",
    "pydantic-settings>=2.12.0",
    "uvicorn>=0.38.0",
]
