From bfbda3066e5f7f6b5a0e4d61acf07911814eddc9 Mon Sep 17 00:00:00 2001 From: Richard Ipsum Date: Mon, 10 Nov 2014 17:07:37 +0000 Subject: fix conflict symbols emitted by check_lt and check_gt --- exts/pip_find_deps.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/exts/pip_find_deps.py b/exts/pip_find_deps.py index 1af1ff0..f5f5715 100755 --- a/exts/pip_find_deps.py +++ b/exts/pip_find_deps.py @@ -183,24 +183,28 @@ def check_eqs(dep, version): dep.conflicts.append((dep.greater_than.spec, ('==', version))) def check_lt(dep, version, inclusive=False): + lt_symbol = '<=' if inclusive else '<' + if dep.is_unconstrained(): dep.less_than = LowerBound(version, inclusive) elif dep.is_unbounded(): if dep.absolute >= version: - dep.conflicts.append((('==', dep.absolute), ('<', version))) + dep.conflicts.append((('==', dep.absolute), (lt_symbol, version))) elif dep.greater_than >= version: - dep.conflicts.append((dep.greater_than.spec, ('<', version))) + dep.conflicts.append((dep.greater_than.spec, (lt_symbol, version))) else: dep.less_than = LowerBound(version, inclusive) def check_gt(dep, version, inclusive=False): + gt_symbol = '>=' if inclusive else '>' + if dep.is_unconstrained(): dep.greater_than = UpperBound(version, inclusive) elif dep.is_unbounded(): if dep.absolute <= version: - dep.conflicts.append((('==', dep.absolute), ('>', version))) + dep.conflicts.append((('==', dep.absolute), (gt_symbol, version))) elif dep.less_than <= version: - dep.conflicts.append((dep.less_than.spec, ('>', version))) + dep.conflicts.append((dep.less_than.spec, (gt_symbol, version))) else: dep.greater_than = UpperBound(version, inclusive) -- cgit v1.2.1