Skip to content

Commit be40099

Browse files
authored
Make prek hook to check shared distributions resilient to empty dirs (#59972)
1 parent 22cb741 commit be40099

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scripts/ci/prek/check_shared_distributions_structure.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,12 @@ def main() -> None:
213213
all_ok = True
214214
for shared_project in SHARED_DIR.iterdir():
215215
if shared_project.is_dir():
216+
# Not having a pyproject.toml means no distribution here, so using it as a marker to skip
217+
if not (shared_project / "pyproject.toml").exists():
218+
console.print(
219+
f"\n[yellow]Skipping empty directory:[/yellow] [magenta]{shared_project.name}[/magenta]"
220+
)
221+
continue
216222
ok = check_shared_distribution(shared_project)
217223
if not ok:
218224
all_ok = False

0 commit comments

Comments
 (0)