Skip to content

Commit

Permalink
Revert "fix(core): use rglob to guess local Python modules (#753)" (#…
Browse files Browse the repository at this point in the history
…798)

This reverts commit 0820845.
  • Loading branch information
mkniewallner authored Aug 7, 2024
1 parent 4b6f210 commit 060f247
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 66 deletions.
2 changes: 1 addition & 1 deletion python/deptry/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def _is_local_module(path: Path) -> bool:
"""Guess if a module is a local Python module."""
return bool(
(path.is_file() and path.name != "__init__.py" and path.suffix == ".py")
or (path.is_dir() and list(path.rglob("*.py")))
or (path.is_dir() and list(path.glob("*.py")))
)

@staticmethod
Expand Down
1 change: 0 additions & 1 deletion tests/data/project_using_namespace/.gitignore

This file was deleted.

Empty file.
7 changes: 0 additions & 7 deletions tests/data/project_using_namespace/foo/database/bar.py

This file was deleted.

17 changes: 0 additions & 17 deletions tests/data/project_using_namespace/pyproject.toml

This file was deleted.

39 changes: 0 additions & 39 deletions tests/functional/cli/test_cli_namespace.py

This file was deleted.

1 change: 0 additions & 1 deletion tests/functional/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class Project(str, Enum):
FUTURE_DEPRECATED_OBSOLETE_ARGUMENT = "project_with_future_deprecated_obsolete_argument"
GITIGNORE = "project_with_gitignore"
MULTIPLE_SOURCE_DIRECTORIES = "project_with_multiple_source_directories"
NAMESPACE = "project_using_namespace"
PDM = "project_with_pdm"
POETRY = "project_with_poetry"
PYPROJECT_DIFFERENT_DIRECTORY = "project_with_pyproject_different_directory"
Expand Down

0 comments on commit 060f247

Please sign in to comment.