commit: 78c1f7595563a40139ad9465822390f58f2950dd Author: Jakov Smolic <jakov.smolic <AT> sartura <DOT> hr> AuthorDate: Thu Dec 3 11:46:14 2020 +0000 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org> CommitDate: Wed Dec 16 08:29:15 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=78c1f759
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 <AT> sartura.hr> Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org> dev-db/pgcli/files/pgcli-3.0.0-sqlparse.patch | 37 ++++++++++++++++++++++ .../{pgcli-3.0.0.ebuild => pgcli-3.0.0-r1.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 00000000000..4403a2e9c03 --- /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 <kevinmar...@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 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 b5da66f7a3d..a7cfb05f2c0 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