From cdbcdca67018fe77ee7a33a11695ca89cf8d476a Mon Sep 17 00:00:00 2001 From: Tim Armstrong Date: Thu, 1 Dec 2016 16:45:15 -0800 Subject: [PATCH] IMPALA-4570: shell tarball breaks with certain setuptools versions The bug was in the third-party pkg_resources.py script. The version check was broken because it matches any version with a "0.7" substring instead of just versions starting with 0.7. This is a known bug. setuptools even re-released 20.7.0 as version 20.8.0 to avoid it: https://github.com/pypa/setuptools/commit/e5822f0d5be6386bf86cde03988bfdf1bfc2e935 Testing: I was unable to reproduce this locally, but I think the fix is clear-cut enough that this is ok. Change-Id: I0565c0e6c1be7d82c3f35d2545ba044a684bb075 Reviewed-on: http://gerrit.cloudera.org:8080/5314 Reviewed-by: Tim Armstrong Tested-by: Impala Public Jenkins --- shell/pkg_resources.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shell/pkg_resources.py b/shell/pkg_resources.py index 92e01db17..aca743a3a 100644 --- a/shell/pkg_resources.py +++ b/shell/pkg_resources.py @@ -2292,7 +2292,7 @@ class Distribution(object): version = self.version except ValueError: version = '' - if '0.7' in version: + if version.startswith('0.7'): raise ValueError( "A 0.7-series setuptools cannot be installed " "with distribute. Found one at %s" % str(self.location)) @@ -2593,7 +2593,7 @@ def _override_setuptools(req): return True for comparator, version in req.specs: if comparator in ['==', '>=', '>']: - if '0.7' in version: + if version.startswith('0.7'): # We want some setuptools not from the 0.6 series. return False return True