We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/1withall/domin8'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
test_import_graph_excludes.py•872 B
from pathlib import Path
from domin8.tools.import_graph import build_import_graph
def test_excludes_are_respected(tmp_path):
repo_root = tmp_path
# Create files inside a venv-like folder and a normal package
(repo_root / "venv").mkdir()
(repo_root / "venv" / "ignored.py").write_text("def should_be_ignored():\n pass\n")
(repo_root / "pkg").mkdir()
(repo_root / "pkg" / "mod.py").write_text("def public():\n return 1\n")
# Add optimization config that excludes venv
cfg_dir = repo_root / "config"
cfg_dir.mkdir()
(cfg_dir / "optimization.json").write_text('{"exclude_globs": ["**/venv/**"]}')
g = build_import_graph(repo_root)
# Ensure that the module in venv is not indexed
assert 'should_be_ignored' not in g.symbol_to_files
# Ensure the real package is indexed
assert 'public' in g.symbol_to_files