[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "codex-lens"
version = "0.1.0"
description = "CodexLens multi-modal code analysis platform"
readme = "README.md"
requires-python = ">=3.10"
license = "MIT"
authors = [
    { name = "CodexLens contributors" }
]
dependencies = [
    "typer~=0.9.0",
    "click>=8.0.0,<9",
    "rich~=13.0.0",
    "pydantic~=2.0.0",
    "tree-sitter~=0.20.0",
    "tree-sitter-python~=0.25.0",
    "tree-sitter-javascript~=0.25.0",
    "tree-sitter-typescript~=0.23.0",
    "pathspec~=0.11.0",
    "watchdog~=3.0.0",
    # ast-grep for pattern-based AST matching (PyO3 bindings)
    # ast-grep-py 0.40+ supports Python 3.13
    "ast-grep-py~=0.40.0",
]

[project.optional-dependencies]
# Semantic search using fastembed (ONNX-based, lightweight ~200MB)
semantic = [
    "numpy~=1.26.0",
    "fastembed~=0.2.1",
    "hnswlib~=0.8.0",
]

# GPU acceleration for semantic search (NVIDIA CUDA)
# Install with: pip install codexlens[semantic-gpu]
semantic-gpu = [
    "numpy~=1.26.0",
    "fastembed~=0.2.1",
    "hnswlib~=0.8.0",
    "onnxruntime-gpu~=1.15.0",  # CUDA support
]

# GPU acceleration for Windows (DirectML - supports NVIDIA/AMD/Intel)
# Install with: pip install codexlens[semantic-directml]
semantic-directml = [
    "numpy~=1.26.0",
    "fastembed~=0.2.1",
    "hnswlib~=0.8.0",
    "onnxruntime-directml~=1.15.0",  # DirectML support
]

# Cross-encoder reranking (second-stage, optional)
# Install with: pip install codexlens[reranker] (default: ONNX backend)
reranker-onnx = [
    "optimum[onnxruntime]~=2.1.0",
    "onnxruntime~=1.23.0",
    "transformers~=4.53.0",
]

# Remote reranking via HTTP API
reranker-api = [
    "httpx~=0.25.0",
]

# LLM-based reranking via ccw-litellm
reranker-litellm = [
    "ccw-litellm~=0.1.0",
]

# Legacy sentence-transformers CrossEncoder reranker
reranker-legacy = [
    "sentence-transformers~=2.2.0",
]

# Backward-compatible alias for default reranker backend
reranker = [
    "optimum[onnxruntime]~=2.1.0",
    "onnxruntime~=1.23.0",
    "transformers~=4.53.0",
]

# Encoding detection for non-UTF8 files
encoding = [
    "chardet~=5.0.0",
]

# Clustering for staged hybrid search (HDBSCAN + sklearn)
clustering = [
    "hdbscan~=0.8.1",
    "scikit-learn~=1.3.0",
]

# Full features including tiktoken for accurate token counting
full = [
    "tiktoken~=0.5.0",
]

# Language Server Protocol support
lsp = [
    "pygls~=1.3.0",
]

[project.scripts]
codexlens-lsp = "codexlens.lsp.server:main"

[project.urls]
Homepage = "https://github.com/openai/codex-lens"

[tool.setuptools]
package-dir = { "" = "src" }

[tool.setuptools.package-data]
"codexlens.lsp" = ["lsp-servers.json"]

[tool.pytest.ini_options]
markers = [
    "integration: marks tests that exercise broader end-to-end or dependency-heavy flows",
]
filterwarnings = [
    "ignore:'BaseCommand' is deprecated and will be removed in Click 9.0.*:DeprecationWarning",
    "ignore:The '__version__' attribute is deprecated and will be removed in Click 9.1.*:DeprecationWarning",
]
