jeffwidman / cqlsh

Home of the cqlsh package on PyPI. Repackages the official Cassandra cqlsh for lighter-weight installs.
Apache License 2.0
21 stars 7 forks source link

'pip install cqlsh' fails for python 2.7 due to new Click release 8.0.0 #3

Closed vimmis closed 3 years ago

vimmis commented 3 years ago

Hi Team,

Today we hit an issue while pip installing cqlsh in a Docker build.

Below is the part of Error

20:24:19 Step 18/28 : RUN pip install cqlsh
20:24:19  ---> Running in e15b4c785dc4
20:24:20 Downloading/unpacking cqlsh
20:24:20 Downloading/unpacking cql (from cqlsh)
20:24:20   Running setup.py (path:/tmp/pip-build-ULJuoZ/cql/setup.py) egg_info for package cql
20:24:20     
20:24:20 Downloading/unpacking cassandra-driver (from cqlsh)
20:24:21   Running setup.py (path:/tmp/pip-build-ULJuoZ/cassandra-driver/setup.py) egg_info for package cassandra-driver
20:24:21     /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'project_urls'
20:24:21       warnings.warn(msg)
20:24:21     
20:24:21 Requirement already satisfied (use --upgrade to upgrade): six in /usr/lib/python2.7/dist-packages (from cqlsh)
20:24:21 Downloading/unpacking thrift (from cql->cqlsh)
20:24:21   Running setup.py (path:/tmp/pip-build-ULJuoZ/thrift/setup.py) egg_info for package thrift
20:24:21     /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'long_description_content_type'
20:24:21       warnings.warn(msg)
20:24:21     
20:24:21     warning: no previously-included files matching '__pycache__' found anywhere in distribution
20:24:21     warning: no previously-included files matching '*.py[co]' found anywhere in distribution
20:24:21 Downloading/unpacking geomet>=0.1,<0.3 (from cassandra-driver->cqlsh)
20:24:21   Downloading geomet-0.2.1.post1.tar.gz
20:24:21   Running setup.py (path:/tmp/pip-build-ULJuoZ/geomet/setup.py) egg_info for package geomet
20:24:21     /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
20:24:21       warnings.warn(msg)
20:24:21     
20:24:21 Downloading/unpacking futures (from cassandra-driver->cqlsh)
20:24:21   Downloading futures-3.3.0-py2-none-any.whl
20:24:21 Downloading/unpacking click (from geomet>=0.1,<0.3->cassandra-driver->cqlsh)
20:24:21   Running setup.py (path:/tmp/pip-build-ULJuoZ/click/setup.py) egg_info for package click
20:24:22     error in click setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers
20:24:22     Complete output from command python setup.py egg_info:
20:24:22     error in click setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers
20:24:22 
20:24:22 ----------------------------------------
20:24:22 Cleaning up...
20:24:22 Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-ULJuoZ/click
20:24:22 Storing debug log for failure in /root/.pip/pip.log
20:24:22 The command '/bin/sh -c pip install cqlsh' returned a non-zero code: 1

Environement: Docker base image used: ruby 2.2.4 Python 2.7.9 pip 1.5.6 from /usr/lib/python2.7/dist-packages (python 2.7)

Click Package latest 8.0.0(Released May 11th) mentions Requires: Python >=3.6, which will have issue for python 2.7 like above.

We have currently fixed it by pre installing the previous compatible version 7.1.2 before installing cqlsh. pip install click==7.1.2 && pip install cqlsh

jeffwidman commented 3 years ago

If you have a newer version of pip, it will honor Click's python_requires directive and ensure it installs an older version of Click which is still compatible.

Your documented workaround is probably the best interim solution until you can upgrade to python 3.

jeffwidman commented 3 years ago

Also, I just promoted the Cassandra 4.0 version of cqlsh from beta to GA... it's python 3 compatible, so that should take care of this problem w/o requiring a workaround:

https://pypi.org/project/cqlsh/6.0.0/