mirror of
https://github.com/safishamsi/graphify.git
synced 2026-09-24 06:26:11 +00:00
- pg_introspect: the psycopg-missing ImportError suggested pip install 'graphify[postgres]', but the PyPI package is graphifyy (double-y) - detect: add .skill (Markdown with YAML frontmatter agent files) to DOC_EXTENSIONS so they are no longer dropped as unclassified - extract: route .skill through extract_markdown for the structural quick-scan Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
75b7279d92
commit
ef8771e8c1
+1
-1
@@ -28,7 +28,7 @@ class FileType(str, Enum):
|
||||
_MANIFEST_PATH = str(out_path("manifest.json"))
|
||||
|
||||
CODE_EXTENSIONS = {'.py', '.ts', '.tsx', '.mts', '.cts', '.js', '.jsx', '.mjs', '.ejs', '.ets', '.go', '.rs', '.java', '.groovy', '.gradle', '.cpp', '.cc', '.cxx', '.c', '.h', '.hpp', '.cu', '.cuh', '.metal', '.rb', '.rake', '.swift', '.kt', '.kts', '.cs', '.scala', '.php', '.lua', '.luau', '.toc', '.zig', '.ps1', '.psm1', '.psd1', '.ex', '.exs', '.m', '.mm', '.jl', '.vue', '.svelte', '.astro', '.dart', '.v', '.sv', '.svh', '.sql', '.r', '.f', '.F', '.f90', '.F90', '.f95', '.F95', '.f03', '.F03', '.f08', '.F08', '.pas', '.pp', '.dpr', '.dpk', '.lpr', '.inc', '.dfm', '.lfm', '.lpk', '.sh', '.bash', '.json', '.tf', '.tfvars', '.hcl', '.dm', '.dme', '.dmi', '.dmm', '.dmf', '.sln', '.slnx', '.csproj', '.fsproj', '.vbproj', '.xaml', '.razor', '.cshtml', '.cls', '.trigger'}
|
||||
DOC_EXTENSIONS = {'.md', '.mdx', '.qmd', '.txt', '.rst', '.html', '.yaml', '.yml'}
|
||||
DOC_EXTENSIONS = {'.md', '.mdx', '.qmd', '.skill', '.txt', '.rst', '.html', '.yaml', '.yml'}
|
||||
PAPER_EXTENSIONS = {'.pdf'}
|
||||
IMAGE_EXTENSIONS = {'.png', '.jpg', '.jpeg', '.gif', '.webp', '.svg'}
|
||||
OFFICE_EXTENSIONS = {'.docx', '.xlsx'}
|
||||
|
||||
@@ -3896,6 +3896,7 @@ _DISPATCH: dict[str, Any] = {
|
||||
".md": extract_markdown,
|
||||
".mdx": extract_markdown,
|
||||
".qmd": extract_markdown,
|
||||
".skill": extract_markdown,
|
||||
".pas": extract_pascal,
|
||||
".pp": extract_pascal,
|
||||
".dpr": extract_pascal,
|
||||
|
||||
@@ -15,7 +15,7 @@ def introspect_postgres(dsn: str | None = None) -> dict:
|
||||
except ModuleNotFoundError:
|
||||
raise ImportError(
|
||||
"psycopg is required for --postgres. "
|
||||
"Install with: pip install 'graphify[postgres]'"
|
||||
"Install with: pip install 'graphifyy[postgres]'"
|
||||
)
|
||||
|
||||
try:
|
||||
|
||||
@@ -23,6 +23,10 @@ def test_classify_powershell_manifest():
|
||||
def test_classify_markdown():
|
||||
assert classify_file(Path("README.md")) == FileType.DOCUMENT
|
||||
|
||||
def test_classify_skill():
|
||||
# #1901: .skill agent files (Markdown with YAML frontmatter) were dropped as unclassified.
|
||||
assert classify_file(Path("10_Orchestrator.skill")) == FileType.DOCUMENT
|
||||
|
||||
def test_classify_pdf():
|
||||
assert classify_file(Path("paper.pdf")) == FileType.PAPER
|
||||
|
||||
|
||||
@@ -313,8 +313,10 @@ def test_pg_introspect_connection_error():
|
||||
def test_pg_introspect_import_error():
|
||||
"""If psycopg is missing, introspect_postgres raises ImportError."""
|
||||
with patch.dict("sys.modules", {"psycopg": None}):
|
||||
with pytest.raises(ImportError, match="psycopg is required"):
|
||||
with pytest.raises(ImportError, match="psycopg is required") as exc_info:
|
||||
introspect_postgres("postgresql://localhost/db")
|
||||
# #1906: the PyPI package is graphifyy (double-y), so the install hint must match
|
||||
assert "graphifyy[postgres]" in str(exc_info.value)
|
||||
|
||||
|
||||
def test_pg_introspect_uri_forward_slashes():
|
||||
|
||||
Reference in New Issue
Block a user