diff options
author | Kubilay Kocak <koobs@FreeBSD.org> | 2019-05-28 08:55:49 +0000 |
---|---|---|
committer | Kubilay Kocak <koobs@FreeBSD.org> | 2019-05-28 08:55:49 +0000 |
commit | 98da32a295e5ed0e1221a470cbc36a63b8ad0ab6 (patch) | |
tree | 397cc220970272ed7ec963204197cc305b741a1e /databases/py-pgcli | |
parent | dee7f6e5397d39a6103273f142caac7ebc3981ac (diff) | |
download | ports-98da32a295e5ed0e1221a470cbc36a63b8ad0ab6.tar.gz ports-98da32a295e5ed0e1221a470cbc36a63b8ad0ab6.zip |
Notes
Diffstat (limited to 'databases/py-pgcli')
-rw-r--r-- | databases/py-pgcli/Makefile | 11 | ||||
-rw-r--r-- | databases/py-pgcli/files/patch-PR1052 | 56 |
2 files changed, 65 insertions, 2 deletions
diff --git a/databases/py-pgcli/Makefile b/databases/py-pgcli/Makefile index 82ec4a702af6..bf4bde013f9a 100644 --- a/databases/py-pgcli/Makefile +++ b/databases/py-pgcli/Makefile @@ -3,6 +3,7 @@ PORTNAME= pgcli PORTVERSION= 2.1.0 +PORTREVISION= 1 CATEGORIES= databases python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -18,15 +19,21 @@ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}cli-helpers>=1.2.0:devel/py-cli-helpers@${PY ${PYTHON_PKGNAMEPREFIX}configobj>=5.0.6:devel/py-configobj@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}humanize>=0.5.1:devel/py-humanize@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pgspecial>=1.11.5:databases/py-pgspecial@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}prompt_toolkit>=2.0.6:devel/py-prompt_toolkit@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}prompt_toolkit>=2.0.6<2.1.0:devel/py-prompt_toolkit@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}psycopg2>=2.7.4:databases/py-psycopg2@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pygments>=2.0:textproc/py-pygments@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}setproctitle>=1.1.9:devel/py-setproctitle@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}sqlparse>=0.2.2:databases/py-sqlparse@${PY_FLAVOR} + ${PYTHON_PKGNAMEPREFIX}sqlparse>=0.2.2<0.4:databases/py-sqlparse@${PY_FLAVOR} +TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest>=2.7.0:devel/py-pytest@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}mock>=1.0.1:devel/py-mock@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pexpect>=0:misc/py-pexpect@${PY_FLAVOR} USES= pgsql python USE_PYTHON= autoplist concurrent distutils NO_ARCH= yes +do-test: + @cd ${WRKSRC} && ${PYTHON_CMD} -m pytest -v -rs + .include <bsd.port.mk> diff --git a/databases/py-pgcli/files/patch-PR1052 b/databases/py-pgcli/files/patch-PR1052 new file mode 100644 index 000000000000..371acb39c406 --- /dev/null +++ b/databases/py-pgcli/files/patch-PR1052 @@ -0,0 +1,56 @@ +# Upgrade to sqlparse 0.3.0 #1052 +# https://github.com/dbcli/pgcli/pull/1052 + +# Unpin psycopg2 +# https://github.com/dbcli/pgcli/issues/1036 +# https://github.com/dbcli/pgcli/pull/1059 + +From 1908142adb80f324d6c795e76e38f7939948d7f1 Mon Sep 17 00:00:00 2001 +From: Amjith Ramanujam <amjith.r@gmail.com> +Date: Mon, 6 May 2019 09:05:56 -0700 +Subject: [PATCH 4/5] Upgrade to sqlparse 0.3.0. + +--- pgcli/packages/sqlcompletion.py.orig 2018-09-28 21:20:16 UTC ++++ pgcli/packages/sqlcompletion.py +@@ -154,7 +154,7 @@ def suggest_type(full_text, text_before_cursor): + # Be careful here because trivial whitespace is parsed as a + # statement, but the statement won't have a first token + tok1 = stmt.parsed.token_first() +- if tok1 and tok1.value == '\\': ++ if tok1 and tok1.value.startswith('\\'): + text = stmt.text_before_cursor + stmt.word_before_cursor + return suggest_special(text) + +@@ -398,7 +398,7 @@ def suggest_based_on_last_token(token, stmt): + elif token_v == 'set': + return (Column(table_refs=stmt.get_tables(), + local_tables=stmt.local_tables),) +- elif token_v in ('select', 'where', 'having', 'by', 'distinct'): ++ elif token_v in ('select', 'where', 'having', 'order by', 'distinct'): + # Check for a table alias or schema qualification + parent = (stmt.identifier and stmt.identifier.get_parent_name()) or [] + tables = stmt.get_tables() +--- setup.py.orig 2019-04-06 00:24:36 UTC ++++ setup.py +@@ -16,8 +16,8 @@ install_requirements = [ + 'click >= 4.1', + 'Pygments >= 2.0', # Pygments has to be Capitalcased. WTF? + 'prompt_toolkit>=2.0.6,<2.1.0', +- 'psycopg2 >= 2.7.4,<2.8', +- 'sqlparse >=0.2.2,<0.3.0', ++ 'psycopg2 >= 2.7.4', ++ 'sqlparse >=0.2.2,<0.4', + 'configobj >= 5.0.6', + 'humanize >= 0.5.1', + 'cli_helpers[styles] >= 1.2.0', +--- tests/test_sqlcompletion.py.orig 2018-01-11 20:31:20 UTC ++++ tests/test_sqlcompletion.py +@@ -236,7 +236,7 @@ def test_distinct_suggests_cols(text): + ( + 'SELECT * FROM tbl x JOIN tbl1 y ORDER BY ', + 'SELECT * FROM tbl x JOIN tbl1 y ORDER BY ', +- 'BY', ++ 'ORDER BY', + ) + ]) + def test_distinct_and_order_by_suggestions_with_aliases(text, text_before, |