jeffwidman / cqlsh Goto Github PK
View Code? Open in Web Editor NEWHome of the cqlsh package on PyPI. Repackages the official Cassandra cqlsh for lighter-weight installs.
License: Apache License 2.0
Home of the cqlsh package on PyPI. Repackages the official Cassandra cqlsh for lighter-weight installs.
License: Apache License 2.0
I'm not sure if this is a packaging issue or an issue with upstream. Any thoughts?
pip install -U --user cqlsh==6.0.0b4
Requirement already satisfied: cqlsh==6.0.0b4 in /home/jkomoroski/.local/lib/python3.11/site-packages (6.0.0b4)
Requirement already satisfied: cql in /home/jkomoroski/.local/lib/python3.11/site-packages (from cqlsh==6.0.0b4) (1.4.0)
Requirement already satisfied: cassandra-driver in /home/jkomoroski/.local/lib/python3.11/site-packages (from cqlsh==6.0.0b4) (3.25.0)
Requirement already satisfied: six in /usr/lib/python3.11/site-packages (from cqlsh==6.0.0b4) (1.16.0)
Requirement already satisfied: geomet<0.3,>=0.1 in /home/jkomoroski/.local/lib/python3.11/site-packages (from cassandra-driver->cqlsh==6.0.0b4) (0.2.1.post1)
Requirement already satisfied: thrift in /home/jkomoroski/.local/lib/python3.11/site-packages (from cql->cqlsh==6.0.0b4) (0.16.0)
Requirement already satisfied: click in /usr/lib/python3.11/site-packages (from geomet<0.3,>=0.1->cassandra-driver->cqlsh==6.0.0b4) (8.1.3)
~/script_test on ☁️ (us-east-2)
at 11:18:44 ❯ which cqlsh
/home/jkomoroski/.local/bin/cqlsh
~/script_test on ☁️ (us-east-2)
at 11:18:54 ❯ cqlsh --version
Traceback (most recent call last):
File "/home/jkomoroski/.local/bin/cqlsh", line 167, in <module>
from cqlshlib import cql3handling, cqlhandling, pylexotron, sslhandling, cqlshhandling
File "/home/jkomoroski/.local/lib/python3.11/site-packages/cqlshlib/cql3handling.py", line 19, in <module>
from cqlshlib.cqlhandling import CqlParsingRuleSet, Hint
File "/home/jkomoroski/.local/lib/python3.11/site-packages/cqlshlib/cqlhandling.py", line 23, in <module>
from cqlshlib import pylexotron, util
File "/home/jkomoroski/.local/lib/python3.11/site-packages/cqlshlib/pylexotron.py", line 342, in <module>
class ParsingRuleSet:
File "/home/jkomoroski/.local/lib/python3.11/site-packages/cqlshlib/pylexotron.py", line 343, in ParsingRuleSet
RuleSpecScanner = SaferScanner([
^^^^^^^^^^^^^^
File "/home/jkomoroski/.local/lib/python3.11/site-packages/cqlshlib/saferscanner.py", line 91, in __init__
s = re.sre_parse.State()
^^^^^^^^^^^^
AttributeError: module 're' has no attribute 'sre_parse'
I believe the logic is reversed. The strip_comment_blocks is meant to remove comments in "..." so it should not go into the if section if re.search('["].[/][].[][/].*["]', statementtext) return None.
https://github.com/jeffwidman/cqlsh/blob/master/cqlsh/cqlsh.py#L905
example:
INSERT INTO DB (abc) VALUES ('/*');
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
I saw that you published the new version 3 days ago but pip install
installing 5.0.4 which doesn't work for me with Python3.
Am I missing something?
As demonstrated in #11, we need some sort of basic sanity checking for PRs.
Ideally we test each PR against all versions of python it claims to support. That way, if there's a packaging issue in an older setuptools
, pip
, python
etc we catch it.
I think all we need to do is wire up something that starts a cassandra docker image and verifies that cqlsh
can connect to it. That would have flagged all the issues I've hit in this repo so far.
Ideally it would both install cqlsh
as a module within another super simple python program and install it as an executable.
Test matrix should probably be supported Python versions (tox
is probably handy) * OS (Linux/Windows). May also want to run against multiple Cassandra versions, although I tend to think that's the domain of the Cassandra project as here we really only control the packaging aspect.
But for starters, even getting one flow working would be great.
As part of CASSANDRA-17684, our proposed solution (in progress) will be to create a new build distribution target of 'doc', which will contain CQL.html and an empty init.py. This will allow cqlsh.py to locate and read the html file as a Python resource (>= 3.7) when cqlsh is pip installed.
Hey,
using python 2.7.18, we've been running 6.0.0 in circleci with success,
but since 6.0.1 we're getting an error:
circleci@ff66acb3ef0c:~$ cqlsh
Traceback (most recent call last):
File "/home/circleci/.pyenv/versions/2.7.18/bin/cqlsh", line 6, in <module>
from cqlsh.__main__ import main
File "/home/circleci/.pyenv/versions/2.7.18/lib/python2.7/site-packages/cqlsh/__main__.py", line 3, in <module>
from cqlsh.cqlsh import main as cqlsh_main
ImportError: No module named cqlsh
First, this package can't be executed using the Python facility for executing modules as scripts
$ python -m cqlsh
python.exe: No module named cqlsh
Second, cqlsh can't be imported as a module. Thus, libraries like:
https://github.com/slowenthal/cql_kernel and
https://github.com/bschoening/cqljupyter
copy and paste the cqlsh.py code. Making this a module would allow for reuse of cqlsh.py and other libraries could simply import 'cqlsh'.
FYI: I've started a discussion with the cassandra team about upstreaming this project into core here: https://issues.apache.org/jira/browse/CASSANDRA-18654
I noticed the dependencies in setup.py include both 'cql' and 'cassandra-driver'. Probably only the later is needed.
The cql package (https://pypi.org/project/cql/1.4.0) is deprecated on their own project page at cassndra-dbapi2 and doesn't work with python 3:
https://code.google.com/archive/a/apache-extras.org/p/cassandra-dbapi2
Python DB-API 2.0 client interface for Cassandra [DEPRECATED]
A DB-API 2.0 compliant client library for Cassandra/CQL
This driver has been deprecated. Please use python-driver https://github.com/datastax/python-driver instead.
The changes in #7 merit a new release.
For simplicity, probably be nice to get a fix for #4 first so that we don't have to cut two releases one right after the other.
cc @bschoening
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.