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
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
_BUILD_OUTPUT_DIRS = {"dist", "build", ".pytmp", ".git", "node_modules", "__pycache__", ".venv", "venv"}
|
||||||
|
|
||||||
|
|
||||||
def _project_shadowing() -> list[str]:
|
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] = []
|
findings: list[str] = []
|
||||||
try:
|
try:
|
||||||
for path in PROJECT_ROOT.rglob("*"):
|
for root, dirs, files in os.walk(PROJECT_ROOT):
|
||||||
if path.name in {"fdb.py", "fdb"} or path.suffix == ".pth":
|
dirs[:] = [d for d in dirs if d not in _BUILD_OUTPUT_DIRS]
|
||||||
findings.append(str(path.resolve(strict=False)))
|
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:
|
except OSError:
|
||||||
return ["<project-scan-unavailable>"]
|
return ["<project-scan-unavailable>"]
|
||||||
return sorted(set(findings))
|
return sorted(set(findings))
|
||||||
|
|||||||
Reference in New Issue
Block a user