forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev-db/pgcli: Support latest sqlparse
Closes: https://bugs.gentoo.org/754669 Package-Manager: Portage-3.0.9, Repoman-3.0.1 Signed-off-by: Jakov Smolic <[email protected]> Signed-off-by: Joonas Niilola <[email protected]>
- Loading branch information
Showing
2 changed files
with
49 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
Taken from: https://github.com/dbcli/pgcli/pull/1224 | ||
Author: Kevin Marsh <[email protected]> | ||
|
||
--- a/pgcli/packages/parseutils/ctes.py | ||
+++ b/pgcli/packages/parseutils/ctes.py | ||
@@ -16,7 +16,7 @@ | ||
def isolate_query_ctes(full_text, text_before_cursor): | ||
"""Simplify a query by converting CTEs into table metadata objects""" | ||
|
||
- if not full_text: | ||
+ if not full_text or not full_text.strip(): | ||
return full_text, text_before_cursor, tuple() | ||
|
||
ctes, remainder = extract_ctes(full_text) | ||
--- a/setup.py | ||
+++ b/setup.py | ||
@@ -13,7 +13,7 @@ | ||
# see: https://github.com/dbcli/pgcli/pull/1197 | ||
"prompt_toolkit>=2.0.6,<4.0.0", | ||
"psycopg2 >= 2.8", | ||
- "sqlparse >=0.3.0,<0.4", | ||
+ "sqlparse >=0.3.0,<0.5", | ||
"configobj >= 5.0.6", | ||
"pendulum>=2.1.0", | ||
"cli_helpers[styles] >= 2.0.0", | ||
--- a/tests/test_sqlcompletion.py | ||
+++ b/tests/test_sqlcompletion.py | ||
@@ -816,7 +816,7 @@ def test_create_db_with_template(): | ||
assert set(suggestions) == set((Database(),)) | ||
|
||
|
||
-@pytest.mark.parametrize("initial_text", ("", " ", "\t \t")) | ||
+@pytest.mark.parametrize("initial_text", ("", " ", "\t \t", "\n")) | ||
def test_specials_included_for_initial_completion(initial_text): | ||
suggestions = suggest_type(initial_text, initial_text) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters