summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Ipsum <richard.ipsum@codethink.co.uk>2014-11-06 16:05:33 +0000
committerRichard Ipsum <richard.ipsum@codethink.co.uk>2014-11-06 16:05:33 +0000
commit676c8b8458e21f351861e6ce5d67c280ca98dcbd (patch)
treee6357bb1fd2d106b420665723a0bce7d50fa27b7
parentdae64ae15175409d91eee251b4c551f5014b191e (diff)
downloadimport-676c8b8458e21f351861e6ce5d67c280ca98dcbd.tar.gz
Move == check out into function
-rwxr-xr-xexts/pip.find_deps52
1 files changed, 28 insertions, 24 deletions
diff --git a/exts/pip.find_deps b/exts/pip.find_deps
index 3a50f1b..e7fabd8 100755
--- a/exts/pip.find_deps
+++ b/exts/pip.find_deps
@@ -108,6 +108,32 @@ class Dependency(object):
self.absolute = version
+def check_eqs(dep, version):
+ if dep.is_unconstrained():
+ dep.set_absolute_version(version)
+ elif version not in dep.excludes:
+ if dep.absolute in [version, None]:
+ if dep.in_bounds(version):
+ dep.set_absolute_version(version)
+ else:
+ warn('conflict! == %s conflicts with %s'
+ % (version,
+ dep.get_bounds_conflict(version)))
+ else:
+ warn('conflict! == %s conflicts with == %s'
+ % (version, dep.absolute))
+ elif version in dep.excludes:
+ warn('conflict! == %s conflicts with != %s'
+ % (version, version))
+ elif version > dep.less_than:
+ # conflict
+ warn('conflict! == %s conflicts with < %s'
+ % (version, dep.less_than))
+ elif version < dep.greater_than:
+ # conflict
+ warn('conflict! == %s conflicts with > %s'
+ % (version, dep.greater_than))
+
def find_build_deps(source, name, version=None):
debug('source: %s' % source)
debug('name: %s' % name)
@@ -149,32 +175,10 @@ def find_build_deps(source, name, version=None):
print('dep.excludes: %s' % str(dep.excludes))
if op == '==':
- if dep.is_unconstrained():
- dep.set_absolute_version(version)
- elif version not in dep.excludes:
- if dep.absolute in [version, None]:
- if dep.in_bounds(version):
- dep.set_absolute_version(version)
- else:
- warn('conflict! == %s conflicts with %s'
- % (version,
- dep.get_bounds_conflict(version)))
- else:
- warn('conflict! == %s conflicts with == %s'
- % (version, dep.absolute))
- elif version in dep.excludes:
- warn('conflict! == %s conflicts with != %s'
- % (version, version))
- elif version > dep.less_than:
- # conflict
- warn('conflict! == %s conflicts with < %s'
- % (version, dep.less_than))
- elif version < dep.greater_than:
- # conflict
- warn('conflict! == %s conflicts with > %s'
- % (version, dep.greater_than))
+ check_eqs(dep, version)
elif op == '!=':
dep.excludes.append(version)
+ # TODO: chk_eqs needed here
elif op == '<':
if dep.is_unconstrained():
dep.less_than = version