From 78c1f7595563a40139ad9465822390f58f2950dd Mon Sep 17 00:00:00 2001 From: Jakov Smolic Date: Thu, 3 Dec 2020 12:46:14 +0100 Subject: [PATCH] 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 Signed-off-by: Joonas Niilola --- dev-db/pgcli/files/pgcli-3.0.0-sqlparse.patch | 37 +++++++++++++++++++ ...cli-3.0.0.ebuild => pgcli-3.0.0-r1.ebuild} | 27 ++++++-------- 2 files changed, 49 insertions(+), 15 deletions(-) create mode 100644 dev-db/pgcli/files/pgcli-3.0.0-sqlparse.patch rename dev-db/pgcli/{pgcli-3.0.0.ebuild => pgcli-3.0.0-r1.ebuild} (55%) 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 0000000000000..4403a2e9c0378 --- /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 + +--- 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 similarity index 55% rename from dev-db/pgcli/pgcli-3.0.0.ebuild rename to dev-db/pgcli/pgcli-3.0.0-r1.ebuild index b5da66f7a3dde..a7cfb05f2c0ae 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/psycopg-2.8.0[${PYTHON_USEDEP}] - >=dev-python/sqlparse-0.3.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