Skip to content

Commit

Permalink
Fix CI errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Zack Weger committed Sep 14, 2020
1 parent 18bac1e commit 2605598
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions poetry/puzzle/solver.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import abc
import enum
import time

Expand Down Expand Up @@ -170,12 +169,7 @@ def solve(self, use_latest=None): # type: (...) -> List[Operation]
operations.append(Uninstall(installed))

return sorted(
operations,
key=lambda o: (
-o.priority,
o.package.name,
o.package.version,
),
operations, key=lambda o: (-o.priority, o.package.name, o.package.version,),
)

def solve_in_compatibility_mode(self, overrides, use_latest=None):
Expand Down Expand Up @@ -239,16 +233,14 @@ def _solve(self, use_latest=None):
return final_packages, depths


class DFSNode(abc.ABC):
class DFSNode(object):
def __init__(self, id, name):
self.id = id
self.name = name

@abc.abstractmethod
def reachable(self):
return []

@abc.abstractmethod
def visit(self, parents):
pass

Expand Down Expand Up @@ -334,7 +326,9 @@ def __init__(
self.optional = dep.is_optional() and not dep.is_activated()
if not is_activated:
self.optional = True
super().__init__((package.name, self.category, self.optional), package.name)
super(PackageNode, self).__init__(
(package.name, self.category, self.optional), package.name
)

def reachable(self):
children = [] # type: List[PackageNode]
Expand Down Expand Up @@ -404,7 +398,7 @@ def reachable(self):
def visit(self, parents):
# The root package, which has no parents, is defined as having depth -1
# So that the root package's top-level dependencies have depth 0.
self.depth = 1 + max((parent.depth for parent in parents), default=-2)
self.depth = 1 + max([parent.depth for parent in parents] + [-2])


def aggregate_package_nodes(nodes, children):
Expand Down

0 comments on commit 2605598

Please sign in to comment.