dbcli / litecli

CLI for SQLite Databases with auto-completion and syntax highlighting
https://litecli.com
BSD 3-Clause "New" or "Revised" License
2.12k stars 68 forks source link

Support sqlparse 0.3.0 #70

Closed shastry closed 4 years ago

shastry commented 5 years ago

Can litecli be updated to work with sqlparse 0.3.0 ?

Got the error message below. Updated setup.py to allow 0.3.0 and it seemed to work fine.

~ ❯❯❯ litecli foo
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 583, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 791, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (sqlparse 0.3.0 (/usr/lib/python3.7/site-packages), Requirement.parse('sqlparse<0.3.0,>=0.2.2'), {'litecli'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/litecli", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3241, in <module>
    @_call_aside
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3225, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3254, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 585, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 598, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'sqlparse<0.3.0,>=0.2.2' distribution was not found and is required by litecli
amjith commented 5 years ago

Yes. It is possible. The reason we pin them is that sometimes a minor version change in sqlparse can sometimes break the autocompletion. I will have to try upgrading locally and see if there are any unhandled corner cases.

I wouldn't mind if you can try a few JOIN statements and sub-SELECT statements to see if you run into any errors. The errors won't be apparent in the CLI but sometimes it will manifest as missing completions when you expect to see them.

olesendan commented 4 years ago

Hi All.

I've installed litecli. I get this error when I try to start litecli.

I'm quite new to linux, so I'm do not know how to apply the fix, by changing setup.py. I can't find a file named setup.py. I'm probely looking in the wrong direction.

Can you guide my a bit more.

Greetings from denmark Dan Olesen

blshkv commented 4 years ago

please fix asap. The version 2.x was released back 2017 and no longer available in many Linux distributions.

amjith commented 4 years ago

Fixed!

I've released a new version (1.3.1). Please install using pip install -U litecli.