Skip to content

Commit

Permalink
Add parent argument to Reporter.adding_requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
pradyunsg committed Apr 29, 2020
1 parent c770818 commit eeceaf6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/reporter_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def get_dependencies(self, candidate):


class Reporter(resolvelib.BaseReporter):
def adding_requirement(self, requirement):
def adding_requirement(self, requirement, parent):
print(f"Adding {requirement}")

def backtracking(self, candidate):
Expand Down
2 changes: 1 addition & 1 deletion src/resolvelib/reporters.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def ending(self, state):
"""Called before the resolution ends successfully.
"""

def adding_requirement(self, requirement):
def adding_requirement(self, requirement, parent):
"""Called when adding a new requirement into the resolve criteria.
"""

Expand Down
2 changes: 1 addition & 1 deletion src/resolvelib/resolvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def _push_new_state(self):
self._states.append(state)

def _merge_into_criterion(self, requirement, parent):
self._r.adding_requirement(requirement)
self._r.adding_requirement(requirement, parent)
name = self._p.identify(requirement)
try:
crit = self.state.criteria[name]
Expand Down

0 comments on commit eeceaf6

Please sign in to comment.