From 8787ab96b01df209dd4bf72980c5fcfcb621534e Mon Sep 17 00:00:00 2001 From: Richard Ipsum Date: Mon, 10 Nov 2014 11:36:59 +0000 Subject: Replace less_than with lower bounds --- exts/pip_find_deps.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/exts/pip_find_deps.py b/exts/pip_find_deps.py index 2c5c364..92237b7 100755 --- a/exts/pip_find_deps.py +++ b/exts/pip_find_deps.py @@ -75,6 +75,7 @@ class Bound(object): self.value = value self.inclusive = inclusive self.bound_type = bound_type + self.symbols = {'lower': ['<', '<='], 'upper': ['>', '>=']} # TODO: quite sure there's a much nicer way to be doing this sort of thing # probably by defining __lt__, __eq__, __gt__ ourselves @@ -85,7 +86,7 @@ class Bound(object): return x >= self.value if self.inclusive else x > self.value def _symbol(self): - return '' + return self.symbols[self.bound_type][self.inclusive] @property def spec(self): @@ -127,7 +128,7 @@ class Dependency(object): def get_bounds_conflict(self, version): if not self._in_less_than(version): - return ('<', self.less_than) + return self.less_than.spec elif not self._in_greater_than(version): return ('>', self.greater_than) else: @@ -157,7 +158,7 @@ def check_eqs(dep, version): elif version in dep.excludes: dep.conflicts.append((('!=', version), ('==', version))) elif version > dep.less_than: - dep.conflicts.append((('<', dep.less_than), ('==', version))) + dep.conflicts.append((dep.less_than.spec, ('==', version))) elif version < dep.greater_than: dep.conflicts.append((('>', dep.greater_than), ('==', version))) @@ -184,7 +185,7 @@ def check_gt(dep, version): if dep.absolute <= version: dep.conflicts.append((('==', dep.absolute), ('>', version))) elif dep.less_than <= version: - dep.conflicts.append((('<', dep.less_than), ('>', version))) + dep.conflicts.append((dep.less_than.spec, ('>', version))) else: dep.greater_than = version -- cgit v1.2.1