Skip to content

Commit 66c76df

Browse files
committed
Fix flake8 issues
Signed-off-by: Stefano Bennati <stefano.bennati@here.com>
1 parent b66a6ff commit 66c76df

File tree

2 files changed

+6
-22
lines changed

2 files changed

+6
-22
lines changed

src/resolvelib/resolvers.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,10 @@ def _backjump(self, causes):
283283
284284
Each iteration of the loop will:
285285
286-
1. Identify Z. The incompatibility is not necessarily caused by the latest state.
286+
1. Identify Z. The incompatibility is not always caused by the latest state.
287287
For example, given three requirements A, B and C, with dependencies
288-
A1, B1 and C1, where A1 and B1 are incompatible:
289-
the last state might be related to C, so we want to discard the previous state.
288+
A1, B1 and C1, where A1 and B1 are incompatible: the last state
289+
might be related to C, so we want to discard the previous state.
290290
2. Discard Z.
291291
3. Discard Y but remember its incompatibility information gathered
292292
previously, and the failure we're dealing with right now.
@@ -310,9 +310,10 @@ def _backjump(self, causes):
310310
# Retrieve the last candidate pin and known incompatibilities.
311311
try:
312312
broken_state = self._states.pop()
313-
except:
313+
except IndexError:
314314
raise Exception(
315-
"Exhausted all states during backjumping, impossible to find a fully-compatible dependency tree."
315+
"Exhausted all states during backjumping, "
316+
"impossible to find a fully-compatible dependency tree."
316317
)
317318
name, candidate = broken_state.mapping.popitem()
318319
current_dependencies = {

tests/test_resolvers.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
from typing import (
2-
Any,
3-
Iterable,
4-
Iterator,
5-
List,
6-
Mapping,
7-
Sequence,
8-
Set,
9-
Tuple,
10-
Union,
11-
)
12-
131
import pytest
142
from packaging.requirements import Requirement
153
from packaging.version import Version
@@ -22,8 +10,6 @@
2210
Resolver,
2311
)
2412
from resolvelib.resolvers import (
25-
Criterion,
26-
RequirementInformation,
2713
RequirementsConflicted,
2814
Resolution,
2915
)
@@ -171,9 +157,6 @@ def test_pin_conflict_with_self(monkeypatch, reporter):
171157
Verify correct behavior of attempting to pin a candidate version that conflicts
172158
with a previously pinned (now invalidated) version for that same candidate (#91).
173159
"""
174-
Candidate = Tuple[
175-
str, Version, Sequence[str]
176-
] # name, version, requirements
177160
all_candidates = {
178161
"parent": [("parent", Version("1"), ["child<2"])],
179162
"child": [

0 commit comments

Comments
 (0)