Skip to content

Commit

Permalink
fix to handle optional dev-dependencies (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
apoclyps authored Dec 15, 2022
1 parent d73eee5 commit 78bf12f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions deps/pipenv/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,15 @@ def extract_package_versions(self, repo: str, content: str | None) -> dict:
if not content:
return self.versions_by_service

data = toml.loads(content)
data: dict = toml.loads(content)
poetry_sections: dict = data.get("tool", {}).get("poetry", {})

for name, version in data["tool"]["poetry"]["dependencies"].items():
for name, version in poetry_sections.get("dependencies", {}).items():
version = version.replace("=", "")
self._add_version_by_service(repo=repo, name=name, version=version)

for name, version in data["tool"]["poetry"]["dev-dependencies"].items():
for name, version in poetry_sections.get("dev-dependencies", {}).items():
version = version.replace("=", "")
self._add_version_by_service(repo=repo, name=name, version=version)

return self.versions_by_service

0 comments on commit 78bf12f

Please sign in to comment.