[project] name = "code-graph-rag" version = "0.0.605" description = "The ultimate RAG for your monorepo. Query, understand, and edit multi-language codebases with the power of AI and knowledge graphs" readme = "PYPI_README.md" requires-python = ">=3.12" license = "MIT" classifiers = [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "Operating System :: OS Independent", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Software Development :: Code Generators", "Topic :: Software Development :: Libraries :: Python Modules", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", ] keywords = [ "rag", "retrieval-augmented-generation", "knowledge-graph", "code-analysis", "tree-sitter", "mcp", "mcp-server", "llm", "graph-database", "semantic-search", "codebase", "memgraph", "developer-tools", "monorepo", ] dependencies = [ "loguru>=0.7.3", "mcp>=1.28.1", "pydantic-ai>=2.0.0", "pydantic-settings>=2.12.0", "pymgclient>=1.5.1", "python-dotenv>=1.2.1", "tiktoken>=0.12.0", "toml>=0.10.2", "tree-sitter-python>=0.25.0", "tree-sitter==0.25.2", "watchdog>=6.0.0", "typer>=0.21.1", "rich>=14.2.0", "prompt-toolkit>=3.0.52", "diff-match-patch>=20241021", "click>=8.3.1", "protobuf>=6.33.5", "defusedxml>=0.7.1", "huggingface-hub[hf-xet]>=1.7.2", "pathspec>=1.0.4", ] [project.scripts] code-graph-rag = "codebase_rag.cli:app" cgr = "codebase_rag.cli:app" [tool.uv] package = true # Patched grammars: upstream tree-sitter-c drops declarations after a # #define whose value embeds a block comment (issue #555). Our forks carry # the repeat(preproc_arg) fix; drop these overrides once upstream releases it. [tool.uv.sources] tree-sitter-c = { git = "https://github.com/vitali87/tree-sitter-c", rev = "fa327ad98f847f8173fc46926be4165c7971f960" } tree-sitter-cpp = { git = "https://github.com/vitali87/tree-sitter-cpp", rev = "b4a7be2f62f36dd460a14b2d1728d42d81d2c486" } [tool.setuptools.packages.find] include = ["codebase_rag*", "codec*", "cgr*"] exclude = ["*.tests", "*.tests.*"] [tool.setuptools.package-data] codebase_rag = [ "docker-compose.yaml", "parsers/csharp_frontend/roslyn/*.cs", "parsers/csharp_frontend/roslyn/*.csproj", "parsers/ast_grep_patterns/*.yaml", "analyzers/ast_grep_rules/*/*.yaml", ] [project.optional-dependencies] test = [ "pytest>=8.4.1", "pytest-asyncio>=1.0.0", "pytest-cov>=4.0.0", "pytest-xdist>=3.8.0", "testcontainers>=4.9.0", "libclang>=18.1.1", "filelock>=3.12", "ast-grep-py>=0.44.0", "pyyaml>=6.0", ] treesitter-full = [ "tree-sitter-python>=0.23.6", "tree-sitter-javascript>=0.23.1", "tree-sitter-typescript>=0.23.2", "tree-sitter-rust>=0.24.0", "tree-sitter-go>=0.23.4", "tree-sitter-scala>=0.24.0", "tree-sitter-java>=0.23.5", "tree-sitter-c>=0.24.1", "tree-sitter-cpp>=0.23.0", "tree-sitter-lua>=0.0.19", "tree-sitter-php>=0.24.1", "tree-sitter-c-sharp>=0.23.5", "tree-sitter-dart>=0.1.0", ] semantic = [ "qdrant-client>=1.9.0", "torch>=2.6.0", "transformers>=4.0.0", ] milvus = [ "pymilvus[milvus-lite]>=3.0.0", ] ast-grep = [ "ast-grep-py>=0.44.0", "pyyaml>=6.0", ] [tool.ruff] line-length = 88 target-version = "py312" exclude = ["codec/", "benchmarks/", "optimize/"] [tool.ruff.lint] select = ["E", "F", "W", "I", "UP", "PL", "T201"] ignore = [ "E501", # line too long "PLR2004", # magic value comparison (too noisy) "PLC0415", # import not at top-level (intentional lazy imports) "PLR0913", # too many arguments (often unavoidable) "PLR0911", # too many return statements "PLR0912", # too many branches "PLR0915", # too many statements "PLW2901", # loop variable overwritten (intentional for .strip()) "PLW0603", # global statement (singleton pattern) ] [tool.ruff.lint.per-file-ignores] "**/tests/**" = ["T201"] "benchmarks/**" = ["T201"] [tool.ruff.format] quote-style = "double" [tool.ty.environment] python-version = "3.12" [tool.ty.src] exclude = ["codebase_rag/tests/test_cypher_queries.py", "codebase_rag/tests/test_code_retrieval.py", "codebase_rag/tests/test_call_resolver.py", "benchmarks/", "optimize/"] [tool.pytest.ini_options] asyncio_mode = "auto" # loadgroup honors the xdist_group marker that pins the integration dir to # one worker; for unmarked tests it schedules identically to the default. # xdist workers decide their grouping flag from the parsed args/ini before # any conftest hook fires (xdist remote.py setup_config), so this must be # an ini-level option; every dependency set that carries pytest also # carries pytest-xdist, so the flag always parses. addopts = "--dist=loadgroup" testpaths = ["codebase_rag/tests"] norecursedirs = ["grammars", ".git", "__pycache__", "*.egg-info", ".venv", "venv"] python_files = ["test_*.py", "*_test.py"] python_classes = ["Test*"] python_functions = ["test_*"] markers = [ "slow: marks tests as slow (may download models or require external services)", "integration: marks tests as integration tests requiring Docker", "e2e: marks tests as end-to-end tests", ] [dependency-groups] dev = [ "bandit>=1.9.2", "coverage>=7.13.0", "pre-commit>=4.2.0", "pyinstaller>=6.14.1", "pylint>=4.0.4", "pytest>=9.0.2", "pytest-xdist>=3.8.0", "radon>=6.0.1", "ruff>=0.5.5", "semgrep>=1.79.0", "ty>=0.0.7", "types-protobuf>=5.0.0", "types-toml>=0.10.8.20240310", "vulture>=2.14", ] docs = [ "mkdocs>=1.6.1,<2", "mkdocs-material>=9.7.3", "mkdocs-minify-plugin>=0.8.0", ] fuzz = [ "atheris>=2.3.0", ] [tool.bandit] exclude_dirs = ["codebase_rag/tests", "scripts", "benchmarks", "optimize"] skips = ["B101"]