From 8dad0cbac60ab5f0de95d9a697ea21bd92147493 Mon Sep 17 00:00:00 2001 From: Dan Root Date: Mon, 2 May 2016 18:54:41 -0700 Subject: [PATCH] Don't use six.PY2 in setup.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit six is not guaranteed to be installed before running pip/setuptools. The client fails to install on a machine or fresh virtualenv without six with errors like the following: ``` ; virtualenv ve ; ./ve/bin/pip install riak Collecting riak Downloading riak-2.5.0.tar.gz (193kB) 100% |████████████████████████████████| 196kB 9.2MB/s Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 20, in File "/tmp/pip-build-ReAmHf/riak/setup.py", line 4, in import six ImportError: No module named six ``` This snuck past tox testing, because six is listed as an explict dependency in tox.ini. --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 6338efd8..54ae8418 100755 --- a/setup.py +++ b/setup.py @@ -1,7 +1,6 @@ #!/usr/bin/env python import codecs -import six import sys from setuptools import setup, find_packages @@ -15,7 +14,7 @@ install_requires.append("pyOpenSSL >= 0.14") requires.append("pyOpenSSL(>=0.14)") -if six.PY2: +if sys.version_info[0:3] <= (3, 0, 0): install_requires.append('protobuf >=2.4.1, <2.7.0') requires.append('protobuf(>=2.4.1, <2.7.0)') else: