MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / _is_python_package_dir

Function _is_python_package_dir

graphify/extractors/resolution.py:3483–3494  ·  view source on GitHub ↗
(directory: Path, suffixes: tuple[str, ...] = (".py",))

Source from the content-addressed store, hash-verified

3481 return names
3482
3483def _is_python_package_dir(directory: Path, suffixes: tuple[str, ...] = (".py",)) -> bool:
3484 if any(
3485 (directory / f"__init__{suffix}").is_file()
3486 and effective_suffix(directory / f"__init__{suffix}") in suffixes
3487 for suffix in suffixes
3488 ):
3489 return True
3490 return any(
3491 (directory / f"__init__{suffix}").is_file()
3492 for suffix in _declared_language_suffixes(suffixes)
3493 if suffix not in suffixes
3494 )
3495
3496
3497def _probe_declared_python_module_candidate(candidate: Path) -> Path | None:

Callers 5

_namespaceFunction · 0.85

Calls 2

effective_suffixFunction · 0.90

Tested by

no test coverage detected