Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix(dependency_getter): only check for tool.poetry to detect Poetry
  • Loading branch information
mkniewallner committed Jul 5, 2024
commit 4baaadb2fa5332b8a6aa8cba7ed2857741c91470
6 changes: 3 additions & 3 deletions python/deptry/dependency_getter/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ def _project_contains_pyproject_toml(self) -> bool:
@staticmethod
def _project_uses_poetry(pyproject_toml: dict[str, Any]) -> bool:
try:
pyproject_toml["tool"]["poetry"]["dependencies"]
pyproject_toml["tool"]["poetry"]
logging.debug(
"pyproject.toml contains a [tool.poetry.dependencies] section, so Poetry is used to specify the"
"pyproject.toml contains a [tool.poetry] section, so Poetry is used to specify the"
" project's dependencies."
)
except KeyError:
logging.debug(
"pyproject.toml does not contain a [tool.poetry.dependencies] section, so Poetry is not used to specify"
"pyproject.toml does not contain a [tool.poetry] section, so Poetry is not used to specify"
" the project's dependencies."
)
return False
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/dependency_getter/test_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def test_dependency_specification_not_found_raises_exception(tmp_path: Path, cap
assert caplog.messages == [
"pyproject.toml found!",
(
"pyproject.toml does not contain a [tool.poetry.dependencies] section, so Poetry is not used to specify the"
"pyproject.toml does not contain a [tool.poetry] section, so Poetry is not used to specify the"
" project's dependencies."
),
(
Expand Down