Skip to content

Commit

Permalink
Parse hashes in a more type-friendly way
Browse files Browse the repository at this point in the history
  • Loading branch information
maresb committed Sep 17, 2022
1 parent 21ca1e2 commit 6d9453f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion conda_lock/pypi_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,10 @@ def solve_pypi(
else:
link = chooser.choose_for(op.package)
url = link.url_without_fragment
hash = src_parser.HashModel(**{link.hash_name: link.hash})
hashes: Dict[str, str] = {}
if link.hash_name is not None and link.hash is not None:
hashes[link.hash_name] = link.hash
hash = src_parser.HashModel.parse_obj(hashes)

requirements.append(
src_parser.LockedDependency(
Expand Down

0 comments on commit 6d9453f

Please sign in to comment.