Skip to content

Commit 669e28f

Browse files
committed
pylock: algorithms_guaranteed is a SHOULD
1 parent 9114668 commit 669e28f

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

src/pip/_internal/models/pylock.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import dataclasses
2-
import hashlib
32
import logging
43
import re
54
import sys
@@ -235,10 +234,6 @@ def _validate_path_url(path: Optional[str], url: Optional[str]) -> None:
235234
def _validate_hashes(hashes: Mapping[str, Any]) -> None:
236235
if not hashes:
237236
raise PylockValidationError("At least one hash must be provided")
238-
if not any(algo in hashlib.algorithms_guaranteed for algo in hashes):
239-
raise PylockValidationError(
240-
"At least one hash algorithm must be in hashlib.algorithms_guaranteed"
241-
)
242237
if not all(isinstance(hash, str) for hash in hashes.values()):
243238
raise PylockValidationError("Hash values must be strings")
244239

tests/unit/test_pylock.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,6 @@ def test_pylock_tool() -> None:
262262
@pytest.mark.parametrize(
263263
"hashes,expected_error",
264264
[
265-
(
266-
{
267-
"sha2": "f" * 40,
268-
},
269-
"At least one hash algorithm must be in hashlib.algorithms_guaranteed",
270-
),
271265
(
272266
{
273267
"sha256": "f" * 40,

0 commit comments

Comments
 (0)