Skip to content

Commit 743e1a6

Browse files
committed
First attempt at reading poetry requirements
1 parent f832a35 commit 743e1a6

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

checkdeps/metadata.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
"""
2-
This is a low-deps simplified version of dowsing that only supports pep 621
3-
and setup.cfg metadata for requirements. There's probably a need for dowsing-lite (or
4-
making dowsing itself the lite version) as well as performing automated edits.
2+
This is a low-deps simplified version of dowsing that only supports pep 621,
3+
flit, poetry, and setup.cfg metadata for requirements. There's probably a need
4+
for dowsing-lite (or making dowsing itself the lite version) as well as
5+
performing automated edits.
56
"""
67

78
import logging
@@ -84,6 +85,12 @@ def get_metadata_requirements(target_dir: Path) -> Dict[str, Sequence[Requiremen
8485
):
8586
ret[k] = [Requirement(i) for i in v]
8687

88+
# Poetry
89+
deps = doc.get("tool", {}).get("poetry", {}).get("dependencies", {})
90+
if deps:
91+
ret[""] = [Requirement(i) for i in deps]
92+
# TODO tool.poetry.group.dev.dependencies
93+
8794
return ret
8895

8996

0 commit comments

Comments
 (0)