testing/mycli: use upstream patch for newer version of py3-sqlparse

it blocks upgrade of `community/py-sqlparse`
This commit is contained in:
Andy Postnikov 2019-06-14 20:04:31 +03:00 committed by Leo
parent e3bbc69843
commit 4e5924a78d
2 changed files with 43 additions and 4 deletions

View File

@ -2,7 +2,7 @@
# Maintainer: Thomas Boerger <thomas@webhippie.de>
pkgname=mycli
pkgver=1.19.0
pkgrel=1
pkgrel=2
pkgdesc="MySQL CLI with autocompletion and syntax highlighting"
url="https://www.mycli.net"
arch="noarch"
@ -13,13 +13,15 @@ depends="python3
py3-pygments
py3-prompt_toolkit>2.0.0
py3-pymysql
py3-sqlparse<0.3.0
py3-sqlparse<0.4.0
py3-configobj
py3-cryptography
py3-cli_helpers"
makedepends="python3-dev py3-setuptools"
checkdepends="pytest py3-mock"
source="$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/${pkgname:0:1}/$pkgname/$pkgname-$pkgver.tar.gz"
source="$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/${pkgname:0:1}/$pkgname/$pkgname-$pkgver.tar.gz
fix-sqlparse.patch
"
builddir="$srcdir/$pkgname-$pkgver"
check() {
@ -37,4 +39,5 @@ package() {
python3 setup.py install --prefix=/usr --root="$pkgdir"
}
sha512sums="6a8477f0bc360708d018e1e44867b7f832cddb5bb1054cecb5fd78e83602c410bdeaca2d1788ee4e53cc5e8d55570792d6bf4cdaad02904a596864595e0738c2 mycli-1.19.0.tar.gz"
sha512sums="6a8477f0bc360708d018e1e44867b7f832cddb5bb1054cecb5fd78e83602c410bdeaca2d1788ee4e53cc5e8d55570792d6bf4cdaad02904a596864595e0738c2 mycli-1.19.0.tar.gz
01f7b8352bb9a36b2a6fb61879479fbcc6c3e26754a68d42531a4aa526f662b360d2d1ab5913646f9540f303115d2914875e37e19fa101fdf8f3b5e7cf388d5d fix-sqlparse.patch"

View File

@ -0,0 +1,36 @@
From 3acecd9d69e87333c1887dc2e797fa20300b9a44 Mon Sep 17 00:00:00 2001
From: Dick Marinus <dick@mrns.nl>
Date: Sat, 18 May 2019 21:15:32 +0200
Subject: [PATCH] fix unit tests, hard depend on 0.3.0
---
mycli/packages/completion_engine.py | 2 +-
setup.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/mycli/packages/completion_engine.py b/mycli/packages/completion_engine.py
index 2426f30c..c63a3428 100644
--- a/mycli/packages/completion_engine.py
+++ b/mycli/packages/completion_engine.py
@@ -84,7 +84,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 = statement.token_first()
- if tok1 and tok1.value in ['\\', 'source']:
+ if tok1 and (tok1.value == 'source' or tok1.value.startswith('\\')):
return suggest_special(text_before_cursor)
last_token = statement and statement.token_prev(len(statement.tokens))[1] or ''
diff --git a/setup.py b/setup.py
index 67ad0c85..3081f19c 100755
--- a/setup.py
+++ b/setup.py
@@ -21,7 +21,7 @@
'Pygments >= 1.6',
'prompt_toolkit>=2.0.6',
'PyMySQL >= 0.9.2',
- 'sqlparse>=0.2.2,<0.3.0',
+ 'sqlparse>=0.3.0,<0.4.0',
'configobj >= 5.0.5',
'cryptography >= 1.0.0',
'cli_helpers[styles] >= 1.0.1',