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

[tool.hatch.build.targets.wheel]
packages = ["src/grover"]

[project]
name = "grover"
version = "0.0.8"
description = "The agentic filesystem. Safe file operations, knowledge graphs, and semantic search — unified for AI agents."
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.12"
authors = [
    { name = "Clay Gendron" },
]
classifiers = [
    "Development Status :: 3 - Alpha",
    "Intended Audience :: Developers",
    "License :: OSI Approved :: Apache Software License",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Programming Language :: Python :: 3.14",
    "Typing :: Typed",
]
dependencies = [
    "pydantic>=2.0",
    "sqlmodel>=0.0.31",
    "sqlalchemy[asyncio]>=2.0",
    "aiosqlite>=0.20",
    "rustworkx>=0.17",
    "unidiff>=0.7",
]

[project.urls]
Homepage = "https://github.com/ClayGendron/grover"
Repository = "https://github.com/ClayGendron/grover"
Issues = "https://github.com/ClayGendron/grover/issues"

[project.optional-dependencies]
search = [
    "usearch>=2.0",
]
treesitter = [
    "tree-sitter>=0.22",
    "tree-sitter-javascript>=0.21",
    "tree-sitter-typescript>=0.21",
    "tree-sitter-go>=0.21",
]
openai = ["openai>=1.0"]
pinecone = ["pinecone[asyncio]>=5.0"]
databricks = ["databricks-vectorsearch>=0.40"]
postgres = ["asyncpg>=0.29"]
mssql = ["aioodbc>=0.5"]
deepagents = ["deepagents>=0.4"]
langchain = ["langchain-core>=0.3"]
langgraph = ["langchain-core>=0.3", "langgraph>=0.2"]
all = ["grover[search,openai,pinecone,databricks,treesitter,postgres,deepagents,langchain,langgraph]"]

[dependency-groups]
dev = [
    "pytest>=8.0",
    "pytest-asyncio>=0.23",
    "pytest-cov>=5.0",
    "pre-commit>=4.0",
    "ipykernel>=7.2.0",
]
docs = [
    "mkdocs-material>=9.0",
]

[tool.ruff]
line-length = 120
target-version = "py312"
src = ["src", "tests"]

[tool.ruff.format]
docstring-code-format = true
docstring-code-line-length = 80

[tool.ruff.lint]
select = [
    "F",      # pyflakes
    "E",      # pycodestyle errors
    "W",      # pycodestyle warnings
    "I",      # isort
    "N",      # pep8-naming
    "UP",     # pyupgrade
    "ANN",    # flake8-annotations
    "B",      # flake8-bugbear
    "A",      # flake8-builtins
    "C4",     # flake8-comprehensions
    "DTZ",    # flake8-datetimez
    "T20",    # flake8-print
    "SIM",    # flake8-simplify
    "TCH",    # flake8-type-checking
    "RUF",    # ruff-specific
    "PTH",    # flake8-use-pathlib
    "PERF",   # perflint
]
ignore = [
    "ANN401",  # dynamically typed expressions (Any)
    "UP046",   # PEP 695 type params — incompatible with SQLModel/ABC metaclasses
]

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
"tests/**/*.py" = ["ANN", "S101"]
"src/grover/providers/search/protocol.py" = ["A002"]  # filter= is the standard vector store API kwarg
"src/grover/providers/search/pinecone.py" = ["A002"]
"src/grover/providers/search/databricks.py" = ["A002"]

[tool.ruff.lint.isort]
known-first-party = ["grover"]

[tool.ty]

[tool.ty.environment]
python-version = "3.13"
root = ["src"]

[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["tests"]
asyncio_mode = "auto"
norecursedirs = ["tests/fixtures/repos"]
markers = [
    "slow: marks tests as slow",
    "integration: marks integration tests",
]

[tool.coverage.run]
source = ["src/grover"]
omit = ["tests/*"]

[tool.coverage.report]
show_missing = true
skip_empty = true
exclude_lines = [
    "pragma: no cover",
    "if TYPE_CHECKING:",
    "if __name__ == .__main__.",
    "@overload",
    "raise NotImplementedError",
    "\\.\\.\\.",
]
