summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakov Smolic <jakov.smolic@sartura.hr>2020-12-03 12:46:14 +0100
committerJoonas Niilola <juippis@gentoo.org>2020-12-16 10:29:15 +0200
commit78c1f7595563a40139ad9465822390f58f2950dd (patch)
treef6551a5a4336a61d1506b101f02e03f793aaa604 /dev-db/pgcli
parentapp-crypt/nwipe: Drop old (diff)
downloadgentoo-78c1f7595563a40139ad9465822390f58f2950dd.tar.gz
gentoo-78c1f7595563a40139ad9465822390f58f2950dd.tar.bz2
gentoo-78c1f7595563a40139ad9465822390f58f2950dd.zip
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 <jakov.smolic@sartura.hr> Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'dev-db/pgcli')
-rw-r--r--dev-db/pgcli/files/pgcli-3.0.0-sqlparse.patch37
-rw-r--r--dev-db/pgcli/pgcli-3.0.0-r1.ebuild (renamed from dev-db/pgcli/pgcli-3.0.0.ebuild)27
2 files changed, 49 insertions, 15 deletions
diff --git a/dev-db/pgcli/files/pgcli-3.0.0-sqlparse.patch b/dev-db/pgcli/files/pgcli-3.0.0-sqlparse.patch
new file mode 100644
index 000000000000..4403a2e9c037
--- /dev/null
+++ b/dev-db/pgcli/files/pgcli-3.0.0-sqlparse.patch
@@ -0,0 +1,37 @@
+Taken from: https://github.com/dbcli/pgcli/pull/1224
+Author: Kevin Marsh <kevinmarsh3@gmail.com>
+
+--- 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)
+
+
diff --git a/dev-db/pgcli/pgcli-3.0.0.ebuild b/dev-db/pgcli/pgcli-3.0.0-r1.ebuild
index b5da66f7a3dd..a7cfb05f2c0a 100644
--- a/dev-db/pgcli/pgcli-3.0.0.ebuild
+++ b/dev-db/pgcli/pgcli-3.0.0-r1.ebuild
@@ -16,26 +16,23 @@ SLOT="0"
KEYWORDS="~amd64 x86"
RDEPEND="
+ dev-python/click[${PYTHON_USEDEP}]
+ dev-python/cli_helpers[${PYTHON_USEDEP}]
+ dev-python/configobj[${PYTHON_USEDEP}]
+ dev-python/humanize[${PYTHON_USEDEP}]
+ dev-python/pgspecial[${PYTHON_USEDEP}]
>=dev-python/prompt_toolkit-3.0.0[${PYTHON_USEDEP}]
- <dev-python/prompt_toolkit-4.0.0[${PYTHON_USEDEP}]
- >=dev-python/psycopg-2.8.0[${PYTHON_USEDEP}]
- >=dev-python/sqlparse-0.3.0[${PYTHON_USEDEP}]
- <dev-python/sqlparse-0.4.0[${PYTHON_USEDEP}]
- >=dev-python/cli_helpers-1.2.0[${PYTHON_USEDEP}]
- >=dev-python/click-4.1[${PYTHON_USEDEP}]
- >=dev-python/configobj-5.0.6[${PYTHON_USEDEP}]
- >=dev-python/humanize-0.5.1[${PYTHON_USEDEP}]
- >=dev-python/pgspecial-1.11.8[${PYTHON_USEDEP}]
- >=dev-python/pygments-2.0[${PYTHON_USEDEP}]
- >=dev-python/setproctitle-1.1.9[${PYTHON_USEDEP}]
-"
+ dev-python/psycopg[${PYTHON_USEDEP}]
+ dev-python/pygments[${PYTHON_USEDEP}]
+ dev-python/setproctitle[${PYTHON_USEDEP}]
+ dev-python/sqlparse[${PYTHON_USEDEP}]"
DEPEND="${RDEPEND}"
-
BDEPEND="
test? (
dev-db/postgresql
dev-python/mock[${PYTHON_USEDEP}]
- )
-"
+ )"
+
+PATCHES=( "${FILESDIR}"/${P}-sqlparse.patch )
distutils_enable_tests pytest