Skip to content

Commit e812942

Browse files
authored
Merge pull request #12295 from hauntsaninja/legacy-resol
2 parents 40c112a + c4e03f3 commit e812942

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

news/4CCE4788-B8B3-402E-9A88-2981AD074999.trivial.rst

Whitespace-only changes.

src/pip/_internal/resolution/legacy/resolver.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
a. "first found, wins" (where the order is breadth first)
1111
"""
1212

13-
# The following comment should be removed at some point in the future.
14-
# mypy: strict-optional=False
15-
1613
import logging
1714
import sys
1815
from collections import defaultdict
@@ -52,7 +49,7 @@
5249

5350
logger = logging.getLogger(__name__)
5451

55-
DiscoveredDependencies = DefaultDict[str, List[InstallRequirement]]
52+
DiscoveredDependencies = DefaultDict[Optional[str], List[InstallRequirement]]
5653

5754

5855
def _check_dist_requires_python(
@@ -321,6 +318,7 @@ def _set_req_to_reinstall(self, req: InstallRequirement) -> None:
321318
"""
322319
# Don't uninstall the conflict if doing a user install and the
323320
# conflict is not a user install.
321+
assert req.satisfied_by is not None
324322
if not self.use_user_site or req.satisfied_by.in_usersite:
325323
req.should_reinstall = True
326324
req.satisfied_by = None
@@ -419,6 +417,8 @@ def _populate_link(self, req: InstallRequirement) -> None:
419417

420418
if self.wheel_cache is None or self.preparer.require_hashes:
421419
return
420+
421+
assert req.link is not None, "_find_requirement_link unexpectedly returned None"
422422
cache_entry = self.wheel_cache.get_cache_entry(
423423
link=req.link,
424424
package_name=req.name,
@@ -532,6 +532,7 @@ def add_req(subreq: Requirement, extras_requested: Iterable[str]) -> None:
532532
with indent_log():
533533
# We add req_to_install before its dependencies, so that we
534534
# can refer to it when adding dependencies.
535+
assert req_to_install.name is not None
535536
if not requirement_set.has_requirement(req_to_install.name):
536537
# 'unnamed' requirements will get added here
537538
# 'unnamed' requirements can only come from being directly

0 commit comments

Comments
 (0)