summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Ipsum <richard.ipsum@codethink.co.uk>2014-11-10 11:36:59 +0000
committerRichard Ipsum <richard.ipsum@codethink.co.uk>2014-11-10 11:36:59 +0000
commit8787ab96b01df209dd4bf72980c5fcfcb621534e (patch)
tree7110b422b93e8d6e9f34945c71e3b08821239f81
parent10cf352707550209e874c69331e49c70458f0130 (diff)
downloadimport-8787ab96b01df209dd4bf72980c5fcfcb621534e.tar.gz
Replace less_than with lower bounds
-rwxr-xr-xexts/pip_find_deps.py9
1 files 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