Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
reporter.py
Go to the documentation of this file.
1from collections import defaultdict
2from logging import getLogger
3from typing import Any, DefaultDict
4
5from pip._vendor.resolvelib.reporters import BaseReporter
6
7from .base import Candidate, Requirement
8
9logger = getLogger(__name__)
10
11
13 def __init__(self) -> None:
14 self.reject_count_by_package: DefaultDict[str, int] = defaultdict(int)
15
17 1: (
18 "pip is looking at multiple versions of {package_name} to "
19 "determine which version is compatible with other "
20 "requirements. This could take a while."
21 ),
22 8: (
23 "pip is still looking at multiple versions of {package_name} to "
24 "determine which version is compatible with other "
25 "requirements. This could take a while."
26 ),
27 13: (
28 "This is taking longer than usual. You might need to provide "
29 "the dependency resolver with stricter constraints to reduce "
30 "runtime. See https://pip.pypa.io/warnings/backtracking for "
31 "guidance. If you want to abort this run, press Ctrl + C."
32 ),
33 }
34
35 def rejecting_candidate(self, criterion: Any, candidate: Candidate) -> None:
36 self.reject_count_by_package[candidate.name] += 1
37
38 count = self.reject_count_by_package[candidate.name]
39 if count not in self._messages_at_reject_count:
40 return
41
42 message = self._messages_at_reject_count[count]
43 logger.info("INFO: %s", message.format(package_name=candidate.name))
44
45 msg = "Will try a different candidate, due to conflict:"
46 for req_info in criterion.information:
48 # Inspired by Factory.get_installation_error
49 msg += "\n "
50 if parent:
51 msg += f"{parent.name} {parent.version} depends on "
52 else:
53 msg += "The user requested "
55 logger.debug(msg)
56
57
59 """A reporter that does an info log for every event it sees."""
60
61 def starting(self) -> None:
62 logger.info("Reporter.starting()")
63
64 def starting_round(self, index: int) -> None:
65 logger.info("Reporter.starting_round(%r)", index)
66
67 def ending_round(self, index: int, state: Any) -> None:
68 logger.info("Reporter.ending_round(%r, state)", index)
69
70 def ending(self, state: Any) -> None:
71 logger.info("Reporter.ending(%r)", state)
72
73 def adding_requirement(self, requirement: Requirement, parent: Candidate) -> None:
74 logger.info("Reporter.adding_requirement(%r, %r)", requirement, parent)
75
76 def rejecting_candidate(self, criterion: Any, candidate: Candidate) -> None:
77 logger.info("Reporter.rejecting_candidate(%r, %r)", criterion, candidate)
78
79 def pinning(self, candidate: Candidate) -> None:
80 logger.info("Reporter.pinning(%r)", candidate)
None adding_requirement(self, Requirement requirement, Candidate parent)
Definition reporter.py:73
None rejecting_candidate(self, Any criterion, Candidate candidate)
Definition reporter.py:76
None rejecting_candidate(self, Any criterion, Candidate candidate)
Definition reporter.py:35
for i