File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -628,6 +628,15 @@ def _extract_local_dependencies( # noqa: PLR0912
628628 " add a `requirements.yaml` or `pyproject.toml` file with"
629629 " `[tool.unidep]` in its directory." ,
630630 )
631+ elif _is_empty_folder (abs_local ):
632+ msg = (
633+ f"`{ local_dependency } ` in `local_dependencies` is not pip"
634+ " installable because it is an empty folder. Is it perhaps"
635+ " an uninitialized Git submodule? If so, initialize it with"
636+ " `git submodule update --init --recursive`. Otherwise,"
637+ " remove it from `local_dependencies`."
638+ )
639+ raise RuntimeError (msg ) from None
631640 elif _is_empty_git_submodule (abs_local ):
632641 # Extra check for empty Git submodules (common problem folks run into)
633642 msg = (
@@ -745,3 +754,8 @@ def _is_empty_git_submodule(path: Path) -> bool:
745754
746755 # Check if it's empty (apart from the .git file)
747756 return len (list (path .iterdir ())) == 1 # Only .git should be present
757+
758+
759+ def _is_empty_folder (path : Path ) -> bool :
760+ """Checks if the given path is an empty folder."""
761+ return not any (path .iterdir ())
You can’t perform that action at this time.
0 commit comments