Skip to content

Commit

Permalink
fix: support pipenv empty packages
Browse files Browse the repository at this point in the history
  • Loading branch information
xzhou-snyk committed Oct 21, 2022
1 parent 7938b02 commit a199379
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 a199379

Please sign in to comment.