feat(release): synthesize initial catalog entries
This commit is contained in:
@@ -331,6 +331,11 @@ def import_source_path(path: Path, *, module: str | None, level: int) -> Path |
|
||||
if src_root is None or module is None:
|
||||
return None
|
||||
candidate = src_root.joinpath(*module.split(".")).with_suffix(".py")
|
||||
if not candidate.exists():
|
||||
top_level = module.split(".", 1)[0]
|
||||
workspace = src_root.parent.parent
|
||||
sibling_src = workspace / top_level.replace("_", "-") / "src"
|
||||
candidate = sibling_src.joinpath(*module.split(".")).with_suffix(".py")
|
||||
if candidate.exists():
|
||||
return candidate
|
||||
init = candidate.with_suffix("") / "__init__.py"
|
||||
|
||||
Reference in New Issue
Block a user