fix: fdb shadowing scan ignores generated build output (dist/build bundles contain fdb)
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -53,12 +53,19 @@ def _metadata_value(metadata: Any, name: str) -> Any:
|
||||
return None
|
||||
|
||||
|
||||
_BUILD_OUTPUT_DIRS = {"dist", "build", ".pytmp", ".git", "node_modules", "__pycache__", ".venv", "venv"}
|
||||
|
||||
|
||||
def _project_shadowing() -> list[str]:
|
||||
"""Source-tree files that could shadow the approved fdb driver. Generated output (PyInstaller dist/build
|
||||
bundles legitimately contain their own fdb package) is not part of the import path and is skipped."""
|
||||
findings: list[str] = []
|
||||
try:
|
||||
for path in PROJECT_ROOT.rglob("*"):
|
||||
if path.name in {"fdb.py", "fdb"} or path.suffix == ".pth":
|
||||
findings.append(str(path.resolve(strict=False)))
|
||||
for root, dirs, files in os.walk(PROJECT_ROOT):
|
||||
dirs[:] = [d for d in dirs if d not in _BUILD_OUTPUT_DIRS]
|
||||
for name in dirs + files:
|
||||
if name in {"fdb.py", "fdb"} or name.endswith(".pth"):
|
||||
findings.append(str((Path(root) / name).resolve(strict=False)))
|
||||
except OSError:
|
||||
return ["<project-scan-unavailable>"]
|
||||
return sorted(set(findings))
|
||||
|
||||
Reference in New Issue
Block a user