build-and-test.sh: fix Python 2.7 build

When building with Python 2.7, the new setuptools 42.0.0 breaks the
kudu-python build with an error like this:

  [1/3] Cythonizing kudu/client.pyx
  [2/3] Cythonizing kudu/errors.pyx
  [3/3] Cythonizing kudu/schema.pyx
  WARNING: The wheel package is not available.
  ERROR: 'pip wheel' requires the 'wheel' package. To fix this, run: pip install wheel
  Traceback (most recent call last):
  File "setup.py", line 216, in <module>
    test_suite="kudu.tests"
  File "/home/jenkins-slave/workspace/kudu-master/3/build/debug/py_env/local/lib/python2.7/site-packages/setuptools/__init__.py", line 144, in setup
    _install_setup_requires(attrs)
  File "/home/jenkins-slave/workspace/kudu-master/3/build/debug/py_env/local/lib/python2.7/site-packages/setuptools/__init__.py", line 139, in _install_setup_requires
    dist.fetch_build_eggs(dist.setup_requires)
  File "/home/jenkins-slave/workspace/kudu-master/3/build/debug/py_env/local/lib/python2.7/site-packages/setuptools/dist.py", line 721, in fetch_build_eggs
    replace_conflicting=True,
  File "/home/jenkins-slave/workspace/kudu-master/3/build/debug/py_env/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 782, in resolve
    replace_conflicting=replace_conflicting
  File "/home/jenkins-slave/workspace/kudu-master/3/build/debug/py_env/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1065, in best_match
    return self.obtain(req, installer)
  File "/home/jenkins-slave/workspace/kudu-master/3/build/debug/py_env/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1077, in obtain
    return installer(requirement)
  File "/home/jenkins-slave/workspace/kudu-master/3/build/debug/py_env/local/lib/python2.7/site-packages/setuptools/dist.py", line 777, in fetch_build_egg
    return fetch_build_egg(self, req)
  File "/home/jenkins-slave/workspace/kudu-master/3/build/debug/py_env/local/lib/python2.7/site-packages/setuptools/installer.py", line 130, in fetch_build_egg
    raise DistutilsError(str(e))
  distutils.errors.DistutilsError: Command '['/home/jenkins-slave/workspace/kudu-master/3/build/debug/py_env/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpK8eEW3', '--quiet', 'pytest-runner']' returned non-zero exit status 1

An easy fix is to pin to an earlier version of setuptools. I don't know why
this doesn't happen on Python 3.

Change-Id: Ia37e164f0319236265165748de47e414a057338f
Reviewed-on: http://gerrit.cloudera.org:8080/14875
Reviewed-by: Andrew Wong <awong@cloudera.com>
Reviewed-by: Bankim Bhavsar <bankim@cloudera.com>
Reviewed-by: Alexey Serbin <aserbin@cloudera.com>
Tested-by: Adar Dembo <adar@cloudera.com>
1 file changed