Skip to content

Commit

Permalink
Merge pull request #192 from snyk/fix/support-pipenv-with-empty-packages
Browse files Browse the repository at this point in the history
fix: support pipenv empty packages
  • Loading branch information
xzhou-snyk authored Oct 25, 2022
2 parents 7938b02 + a199379 commit 43d4b85
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pysrc/pip_resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,10 @@ def get_requirements_list(requirements_file_path, dev_deps=False):
with io.open(requirements_file_path, 'r', encoding='utf-8') as f:
requirements_data = f.read()
parsed_reqs = pipfile.parse(requirements_data)
req_list = list(parsed_reqs.get('packages', []))
parsed_packages = parsed_reqs.get('packages', [])
if parsed_packages is None:
parsed_packages = []
req_list = list(parsed_packages)
if dev_deps:
req_list.extend(parsed_reqs.get('dev-packages', []))
if not req_list:
Expand Down

0 comments on commit 43d4b85

Please sign in to comment.