Closed olofk closed 8 years ago
I see it.
c
is impossible to install because its dependencies conflict. The solver correctly fails to find a solution, but the code that tries to determine why it failed has a type error in it.
In this particular case, it only finds one conflicting requirement but it's expecting two or more (because it's searching for paths). It has a check for this, but it just returns end_clauses
(a tuple of Clause
) which is not the same type as the normal return value paths
(a tuple of tuple of Clause
).
Fix for the unexpected exception is simple, but it won't give you a nice error message without more effort. It seems that we are currently assuming that packages have consistent metadata.
diff --git a/simplesat/sat/minisat.py b/simplesat/sat/minisat.py
index ee442e6..2d0f8b6 100644
--- a/simplesat/sat/minisat.py
+++ b/simplesat/sat/minisat.py
@@ -114,7 +114,7 @@ class UNSAT(object):
# If there aren't two end points then none of this makes any sense.
# Just return what we have.
if len(end_clauses) < 2:
- return end_clauses
+ return (end_clauses,)
ends = OrderedDict.fromkeys(end_clauses)
ends = tuple(ends.keys())
@olofk oh! You're new! Thanks for opening this issue! :+1:
Thanks for the quick response and fix. Yes, I'm new, and I plan to use sat-solver to solve package dependencies for FPGA/ASIC IP cores in my FuseSoC project. Expect to hit more corner cases as I go on. Will report what I find :)
Right now I'm still digging through the sat-solver codebase to understand more about how to use it for its intended purposes
Sounds good!
@olofk the latest 0.2.1
release should fix the AttributeError (but not the lack of good error message)
Not totally sure I have set things up correctly, but the following situation me an internal AttributeError instead of raising SatisfiabilityError.
Stack trace