|
10 | 10 | a. "first found, wins" (where the order is breadth first) |
11 | 11 | """ |
12 | 12 |
|
13 | | -# The following comment should be removed at some point in the future. |
14 | | -# mypy: strict-optional=False |
15 | | - |
16 | 13 | import logging |
17 | 14 | import sys |
18 | 15 | from collections import defaultdict |
|
52 | 49 |
|
53 | 50 | logger = logging.getLogger(__name__) |
54 | 51 |
|
55 | | -DiscoveredDependencies = DefaultDict[str, List[InstallRequirement]] |
| 52 | +DiscoveredDependencies = DefaultDict[Optional[str], List[InstallRequirement]] |
56 | 53 |
|
57 | 54 |
|
58 | 55 | def _check_dist_requires_python( |
@@ -321,6 +318,7 @@ def _set_req_to_reinstall(self, req: InstallRequirement) -> None: |
321 | 318 | """ |
322 | 319 | # Don't uninstall the conflict if doing a user install and the |
323 | 320 | # conflict is not a user install. |
| 321 | + assert req.satisfied_by is not None |
324 | 322 | if not self.use_user_site or req.satisfied_by.in_usersite: |
325 | 323 | req.should_reinstall = True |
326 | 324 | req.satisfied_by = None |
@@ -419,6 +417,8 @@ def _populate_link(self, req: InstallRequirement) -> None: |
419 | 417 |
|
420 | 418 | if self.wheel_cache is None or self.preparer.require_hashes: |
421 | 419 | return |
| 420 | + |
| 421 | + assert req.link is not None, "_find_requirement_link unexpectedly returned None" |
422 | 422 | cache_entry = self.wheel_cache.get_cache_entry( |
423 | 423 | link=req.link, |
424 | 424 | package_name=req.name, |
@@ -532,6 +532,7 @@ def add_req(subreq: Requirement, extras_requested: Iterable[str]) -> None: |
532 | 532 | with indent_log(): |
533 | 533 | # We add req_to_install before its dependencies, so that we |
534 | 534 | # can refer to it when adding dependencies. |
| 535 | + assert req_to_install.name is not None |
535 | 536 | if not requirement_set.has_requirement(req_to_install.name): |
536 | 537 | # 'unnamed' requirements will get added here |
537 | 538 | # 'unnamed' requirements can only come from being directly |
|
0 commit comments