[+] improve typing

This commit is contained in:
Siarhei Siniak 2025-05-20 10:46:04 +03:00
parent a7f6bd927c
commit 5491f92bbe

@ -273,6 +273,8 @@ def pip_resolve(
from pip._internal.utils.hashes import Hashes
from pip._internal.req.req_install import InstallRequirement
from . import cli_bootstrap
downloader_call_def = pip._internal.network.download.Downloader.__call__
def downloader_call(
@ -482,7 +484,7 @@ def pip_resolve(
# ]
# for o in result_requirements
# ], [])
logger.warn(result_requirements)
logger.warning(result_requirements)
res = pip_resolve_t.res_t()
@ -491,7 +493,15 @@ def pip_resolve(
for o in result_requirements:
assert isinstance(o, InstallRequirement)
sha256_hashes = o.hashes()._allowed["sha256"]
sha256_hashes = cli_bootstrap.check_list(
cli_bootstrap.check_dict(
getattr(o.hashes(), '_allowed'),
str,
list[str],
)['sha256'],
str,
)
assert len(sha256_hashes) == 1
assert not o.link is None