public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-db/mycli/files/, dev-db/mycli/
@ 2017-12-27 15:19 Brian Evans
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Evans @ 2017-12-27 15:19 UTC (permalink / raw
  To: gentoo-commits

commit:     9cd12b210006e51c434e513583fbdea2b6ed537b
Author:     Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 27 15:19:20 2017 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Wed Dec 27 15:19:20 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9cd12b21

dev-db/mycli: Add patch to remove distutils tasks from setup.py

Closes: https://bugs.gentoo.org/642394
Package-Manager: Portage-2.3.19, Repoman-2.3.6

 dev-db/mycli/files/remove-tasks.patch                     | 15 +++++++++++++++
 .../{mycli-1.15.0-r1.ebuild => mycli-1.15.0-r2.ebuild}    |  2 ++
 2 files changed, 17 insertions(+)

diff --git a/dev-db/mycli/files/remove-tasks.patch b/dev-db/mycli/files/remove-tasks.patch
new file mode 100644
index 00000000000..94502e6b656
--- /dev/null
+++ b/dev-db/mycli/files/remove-tasks.patch
@@ -0,0 +1,15 @@
+diff --git a/setup.py b/setup.py
+index 882fe92..f0d28ab 100755
+--- a/setup.py
++++ b/setup.py
+@@ -36,10 +36,6 @@ setup(
+     install_requires=install_requirements,
+     entry_points={
+         'console_scripts': ['mycli = mycli.main:cli'],
+-        'distutils.commands': [
+-            'lint = tasks:lint',
+-            'test = tasks:test',
+-        ],
+     },
+     classifiers=[
+         'Intended Audience :: Developers',

diff --git a/dev-db/mycli/mycli-1.15.0-r1.ebuild b/dev-db/mycli/mycli-1.15.0-r2.ebuild
similarity index 95%
rename from dev-db/mycli/mycli-1.15.0-r1.ebuild
rename to dev-db/mycli/mycli-1.15.0-r2.ebuild
index 1ea48bf2b52..1782a8aa2bb 100644
--- a/dev-db/mycli/mycli-1.15.0-r1.ebuild
+++ b/dev-db/mycli/mycli-1.15.0-r2.ebuild
@@ -27,3 +27,5 @@ RDEPEND="
 	>=dev-python/python-sqlparse-0.2.2[${PYTHON_USEDEP}]
 	!>=dev-python/python-sqlparse-0.3.0
 "
+
+PATCHES=( "${FILESDIR}/remove-tasks.patch" )


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-db/mycli/files/, dev-db/mycli/
@ 2019-08-23 14:10 Brian Evans
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Evans @ 2019-08-23 14:10 UTC (permalink / raw
  To: gentoo-commits

commit:     69128ca8b84c1ae69effe5ecc6b27b04b840983e
Author:     Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 23 14:09:25 2019 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Fri Aug 23 14:10:25 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=69128ca8

dev-db/mycli: Drop old

Package-Manager: Portage-2.3.72, Repoman-2.3.17
Signed-off-by: Brian Evans <grknight <AT> gentoo.org>

 dev-db/mycli/Manifest                 |  2 --
 dev-db/mycli/files/remove-tasks.patch | 15 -------------
 dev-db/mycli/mycli-1.15.0-r2.ebuild   | 31 --------------------------
 dev-db/mycli/mycli-1.17.0-r1.ebuild   | 41 -----------------------------------
 4 files changed, 89 deletions(-)

diff --git a/dev-db/mycli/Manifest b/dev-db/mycli/Manifest
index 79066beb3b7..f1c96e7851b 100644
--- a/dev-db/mycli/Manifest
+++ b/dev-db/mycli/Manifest
@@ -1,4 +1,2 @@
-DIST mycli-1.15.0.tar.gz 275065 BLAKE2B 47ae049a7a669d18fc2bb467dd4ee6d1bbe23a86115db6d1965c48c93a2a1be9bb8b4427b377f8ce935b957c854c1c4bf4a87fdea07f27329a13fd6a28b59559 SHA512 7a7d98220c4a679340dbf3c3c9fb3eaab7698f7abbe3e62835a03df10b59c79f0dfd916e9f7b39f12215063849ecadf9d08d086d14b00666b67bac1d092609f2
-DIST mycli-1.17.0.tar.gz 276786 BLAKE2B 203c54b58a7876fd0bab5a05880621263e5cdf786b13207f04dfaf38866f5a7250e8fe8e1c5870aa9d3f562cf9963f15cc433e3ddd2232531f4c823e46778ac7 SHA512 bd64f44ed7b16a1e9c684da52fa60436876b26333e2705e5226c4fab3a979c6680314447333d01e4fdb274d33a7f093cbb2f732e5b4e04c5330066f9918a35ba
 DIST mycli-1.19.0.tar.gz 263255 BLAKE2B 524190429476793af038c8302f43389884a6ee24a05b0b8c739f290dbfdebec3336bd14567eafff2ea3351430791e4844e16dfc5affb1b28bb57d3759b496350 SHA512 8c6003a09a888c2ac6f35a881ca072ba8972f66b13319cbff73f7a525d1f808b767dcef0121b6272a1b82eed1a02c8c417d5805e5a8ce0c141545f28ff3c3a33
 DIST mycli-1.20.1.tar.gz 265264 BLAKE2B d00b1713132609b0a5ec6e8b78785fdab5c6b4db5937bc0b9bc69ddde90ad3dc75aeb99ccf6b5e7fe5e78e9bf4819f03fb454825e5182bc5d2c44356032343d1 SHA512 82ee642b2a4c158b0e2ea275941650125e15004ec1c70b2ab90ae0825090efccb4910a14fd46bcdf795a74adba5689b46de5668447308de63d1cbbbe2e6b0e9d

diff --git a/dev-db/mycli/files/remove-tasks.patch b/dev-db/mycli/files/remove-tasks.patch
deleted file mode 100644
index 94502e6b656..00000000000
--- a/dev-db/mycli/files/remove-tasks.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/setup.py b/setup.py
-index 882fe92..f0d28ab 100755
---- a/setup.py
-+++ b/setup.py
-@@ -36,10 +36,6 @@ setup(
-     install_requires=install_requirements,
-     entry_points={
-         'console_scripts': ['mycli = mycli.main:cli'],
--        'distutils.commands': [
--            'lint = tasks:lint',
--            'test = tasks:test',
--        ],
-     },
-     classifiers=[
-         'Intended Audience :: Developers',

diff --git a/dev-db/mycli/mycli-1.15.0-r2.ebuild b/dev-db/mycli/mycli-1.15.0-r2.ebuild
deleted file mode 100644
index 3356d93de87..00000000000
--- a/dev-db/mycli/mycli-1.15.0-r2.ebuild
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-PYTHON_COMPAT=( python{2_7,3_5,3_6} )
-inherit distutils-r1
-
-DESCRIPTION="CLI for MySQL Database with auto-completion and syntax highlighting"
-
-HOMEPAGE="https://www.mycli.net"
-SRC_URI="https://github.com/dbcli/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-LICENSE="BSD MIT"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE=""
-DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
-RDEPEND="
-	>=dev-python/cli_helpers-1.0.1[${PYTHON_USEDEP}]
-	>=dev-python/click-4.1[${PYTHON_USEDEP}]
-	>=dev-python/configobj-5.0.6[${PYTHON_USEDEP}]
-	>=dev-python/cryptography-1.0.0[${PYTHON_USEDEP}]
-	>=dev-python/prompt_toolkit-1.0.10[${PYTHON_USEDEP}]
-	!>=dev-python/prompt_toolkit-1.1.0
-	>=dev-python/pygments-2.0[${PYTHON_USEDEP}]
-	>=dev-python/pymysql-0.6.7[${PYTHON_USEDEP}]
-	>=dev-python/python-sqlparse-0.2.2[${PYTHON_USEDEP}]
-	!>=dev-python/python-sqlparse-0.3.0
-"
-
-PATCHES=( "${FILESDIR}/remove-tasks.patch" )

diff --git a/dev-db/mycli/mycli-1.17.0-r1.ebuild b/dev-db/mycli/mycli-1.17.0-r1.ebuild
deleted file mode 100644
index e3572fd7e6e..00000000000
--- a/dev-db/mycli/mycli-1.17.0-r1.ebuild
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python{2_7,3_5,3_6} )
-inherit distutils-r1
-
-DESCRIPTION="CLI for MySQL Database with auto-completion and syntax highlighting"
-
-HOMEPAGE="https://www.mycli.net"
-SRC_URI="https://github.com/dbcli/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-LICENSE="BSD MIT"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="test"
-RDEPEND="
-	>=dev-python/cli_helpers-1.0.1[${PYTHON_USEDEP}]
-	>=dev-python/click-4.1[${PYTHON_USEDEP}]
-	>=dev-python/configobj-5.0.6[${PYTHON_USEDEP}]
-	>=dev-python/cryptography-1.0.0[${PYTHON_USEDEP}]
-	>=dev-python/prompt_toolkit-1.0.10[${PYTHON_USEDEP}]
-	<dev-python/prompt_toolkit-1.1.0[${PYTHON_USEDEP}]
-	>=dev-python/pygments-2.0[${PYTHON_USEDEP}]
-	>=dev-python/pymysql-0.9.2[${PYTHON_USEDEP}]
-	>=dev-python/python-sqlparse-0.2.2[${PYTHON_USEDEP}]
-	<dev-python/python-sqlparse-0.3.0[${PYTHON_USEDEP}]
-"
-DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
-	test? ( dev-python/pytest[${PYTHON_USEDEP}] ${RDEPEND} )"
-
-python_test() {
-	pytest --capture=sys \
-		--showlocals \
-		--doctest-modules \
-		--doctest-ignore-import-errors \
-		--ignore=setup.py \
-		--ignore=mycli/magic.py \
-		--ignore=mycli/packages/parseutils.py \
-		--ignore=test/features
-}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-db/mycli/files/, dev-db/mycli/
@ 2020-12-07 19:44 Brian Evans
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Evans @ 2020-12-07 19:44 UTC (permalink / raw
  To: gentoo-commits

commit:     679a025e2b104d3c6466d45480f70574fa2c92d3
Author:     Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Mon Dec  7 19:34:12 2020 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Mon Dec  7 19:44:30 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=679a025e

dev-db/mycli: Version bump to master snapshot for dependency changes

Closes: https://bugs.gentoo.org/754666
Signed-off-by: Brian Evans <grknight <AT> gentoo.org>

 dev-db/mycli/Manifest                           |   1 +
 dev-db/mycli/files/mycli-1.22.2_p20201026.patch | 470 ++++++++++++++++++++++++
 dev-db/mycli/mycli-1.22.2_p20201026.ebuild      |  53 +++
 3 files changed, 524 insertions(+)

diff --git a/dev-db/mycli/Manifest b/dev-db/mycli/Manifest
index ede73337f21..acdc250b5eb 100644
--- a/dev-db/mycli/Manifest
+++ b/dev-db/mycli/Manifest
@@ -1,2 +1,3 @@
 DIST mycli-1.20.1.tar.gz 265264 BLAKE2B d00b1713132609b0a5ec6e8b78785fdab5c6b4db5937bc0b9bc69ddde90ad3dc75aeb99ccf6b5e7fe5e78e9bf4819f03fb454825e5182bc5d2c44356032343d1 SHA512 82ee642b2a4c158b0e2ea275941650125e15004ec1c70b2ab90ae0825090efccb4910a14fd46bcdf795a74adba5689b46de5668447308de63d1cbbbe2e6b0e9d
 DIST mycli-1.21.1.tar.gz 267646 BLAKE2B e0678974949ae219236b89fbe9ebdacfee9c1efc8f92853c937150dbb841680664432e9f5c79181545df8b3321480cf784e45a83139351cc93256d26dcdd66f0 SHA512 beb3888ff8abc2a79e591516d7f0f76d0c18f186bd0dca3b4aadcf93b3045de53ac7f135553ad509273c85ea364e81df5dcadf9eacf1dbef8ceff7345aa5ed6d
+DIST mycli-1.22.2_p20201026.tar.gz 269338 BLAKE2B 42f4349e65a43829691fd7fa0fa1a57968cf34ffba04156ae221d7a2713179826fc09903e45b6f05fbf05688f956a9cd95e87393179992378766b3a3a6ef9c6e SHA512 70d68d7517322b28783c324d463664c2794ba26cc78e0eee056891ce43dbce57c4dd9c13982ac2976af07ff1fa3d4552cb22bf42b9c7885c93483ba86b873636

diff --git a/dev-db/mycli/files/mycli-1.22.2_p20201026.patch b/dev-db/mycli/files/mycli-1.22.2_p20201026.patch
new file mode 100644
index 00000000000..3e7c719bf39
--- /dev/null
+++ b/dev-db/mycli/files/mycli-1.22.2_p20201026.patch
@@ -0,0 +1,470 @@
+diff --git a/.travis.yml b/.travis.yml
+index 0afb5cc..182dea7 100644
+--- a/.travis.yml
++++ b/.travis.yml
+@@ -12,7 +12,7 @@ matrix:
+ 
+ install:
+   - pip install -r requirements-dev.txt
+-  - pip install -e .
++  - pip install --no-cache-dir -e .
+   - sudo rm -f /etc/mysql/conf.d/performance-schema.cnf
+   - sudo service mysql restart
+ 
+diff --git a/README.md b/README.md
+index efe804d..d5a0687 100644
+--- a/README.md
++++ b/README.md
+@@ -96,6 +96,7 @@ $ sudo apt-get install mycli # Only on debian or ubuntu
+       --local-infile BOOLEAN        Enable/disable LOAD DATA LOCAL INFILE.
+       --login-path TEXT             Read this path from the login file.
+       -e, --execute TEXT            Execute command and quit.
++      --init-command TEXT           SQL statement to execute after connecting.
+       --help                        Show this message and exit.
+ 
+ Features
+diff --git a/changelog.md b/changelog.md
+index a4fea35..508c801 100644
+--- a/changelog.md
++++ b/changelog.md
+@@ -1,9 +1,22 @@
++TBD
++===
++
++Features:
++---------
++
++* Add an option `--init-command` to execute SQL after connecting (Thanks: [KITAGAWA Yasutaka]).
++
++Bug Fixes:
++----------
++* Fixed compatibility with sqlparse 0.4 (Thanks: [mtorromeo]).
++
+ 1.22.2
+ ======
+ 
+ Bug Fixes:
+ ----------
+-*  Make the `pwd` module optional. 
++
++*  Make the `pwd` module optional.
+ 
+ 1.22.1
+ ======
+@@ -18,6 +31,11 @@ Features:
+ * Add an option `--list-ssh-config` to list ssh configurations.
+ * Add an option `--ssh-config-path` to choose ssh configuration path.
+ 
++Bug Fixes:
++----------
++
++* Fix specifying empty password with `--password=''` when config file has a password set (Thanks: [Zach DeCook]).
++
+ 
+ 1.21.1
+ ======
+@@ -28,6 +46,7 @@ Bug Fixes:
+ 
+ * Fix broken auto-completion for favorite queries (Thanks: [Amjith]).
+ * Fix undefined variable exception when running with --no-warn (Thanks: [Georgy Frolov])
++* Support setting color for null value (Thanks: [laixintao])
+ 
+ 1.21.0
+ ======
+@@ -768,3 +787,6 @@ Bug Fixes:
+ [François Pietka]: https://github.com/fpietka
+ [Frederic Aoustin]: https://github.com/fraoustin
+ [Georgy Frolov]: https://github.com/pasenor
++[Zach DeCook]: https://zachdecook.com
++[laixintao]: https://github.com/laixintao
++[mtorromeo]: https://github.com/mtorromeo
+diff --git a/mycli/AUTHORS b/mycli/AUTHORS
+index b3636d9..a1204b0 100644
+--- a/mycli/AUTHORS
++++ b/mycli/AUTHORS
+@@ -72,6 +72,10 @@ Contributors:
+   * Jakub Boukal
+   * Takeshi D. Itoh
+   * laixintao
++  * Zach DeCook
++  * kevinhwang91
++  * KITAGAWA Yasutaka
++  * Massimiliano Torromeo
+ 
+ Creator:
+ --------
+diff --git a/mycli/clistyle.py b/mycli/clistyle.py
+index c94f793..293f0f4 100644
+--- a/mycli/clistyle.py
++++ b/mycli/clistyle.py
+@@ -34,6 +34,7 @@ TOKEN_TO_PROMPT_STYLE = {
+     Token.Output.Header: 'output.header',
+     Token.Output.OddRow: 'output.odd-row',
+     Token.Output.EvenRow: 'output.even-row',
++    Token.Output.Null: 'output.null',
+     Token.Prompt: 'prompt',
+     Token.Continuation: 'continuation',
+ }
+diff --git a/mycli/main.py b/mycli/main.py
+index 03797a0..dffd724 100755
+--- a/mycli/main.py
++++ b/mycli/main.py
+@@ -98,7 +98,7 @@ class MyCli(object):
+         xdg_config_home = "~/.config"
+     system_config_files = [
+         '/etc/myclirc',
+-        os.path.join(xdg_config_home, "mycli", "myclirc")
++        os.path.join(os.path.expanduser(xdg_config_home), "mycli", "myclirc")
+     ]
+ 
+     default_config_file = os.path.join(PACKAGE_ROOT, 'myclirc')
+@@ -152,7 +152,7 @@ class MyCli(object):
+                                 c['main'].as_bool('auto_vertical_output')
+ 
+         # Write user config if system config wasn't the last config loaded.
+-        if c.filename not in self.system_config_files:
++        if c.filename not in self.system_config_files and not os.path.exists(myclirc):
+             write_default_config(self.default_config_file, myclirc)
+ 
+         # audit log
+@@ -363,7 +363,7 @@ class MyCli(object):
+     def connect(self, database='', user='', passwd='', host='', port='',
+                 socket='', charset='', local_infile='', ssl='',
+                 ssh_user='', ssh_host='', ssh_port='',
+-                ssh_password='', ssh_key_filename=''):
++                ssh_password='', ssh_key_filename='', init_command=''):
+ 
+         cnf = {'database': None,
+                'user': None,
+@@ -396,7 +396,7 @@ class MyCli(object):
+         port = port or cnf['port']
+         ssl = ssl or {}
+ 
+-        passwd = passwd or cnf['password']
++        passwd = passwd if isinstance(passwd, str) else cnf['password']
+         charset = charset or cnf['default-character-set'] or 'utf8'
+ 
+         # Favor whichever local_infile option is set.
+@@ -420,7 +420,7 @@ class MyCli(object):
+                 self.sqlexecute = SQLExecute(
+                     database, user, passwd, host, port, socket, charset,
+                     local_infile, ssl, ssh_user, ssh_host, ssh_port,
+-                    ssh_password, ssh_key_filename
++                    ssh_password, ssh_key_filename, init_command
+                 )
+             except OperationalError as e:
+                 if ('Access denied for user' in e.args[1]):
+@@ -429,7 +429,7 @@ class MyCli(object):
+                     self.sqlexecute = SQLExecute(
+                         database, user, new_passwd, host, port, socket,
+                         charset, local_infile, ssl, ssh_user, ssh_host,
+-                        ssh_port, ssh_password, ssh_key_filename
++                        ssh_port, ssh_password, ssh_key_filename, init_command
+                     )
+                 else:
+                     raise e
+@@ -1051,6 +1051,8 @@ class MyCli(object):
+               help='Read this path from the login file.')
+ @click.option('-e', '--execute',  type=str,
+               help='Execute command and quit.')
++@click.option('--init-command', type=str,
++              help='SQL statement to execute after connecting.')
+ @click.argument('database', default='', nargs=1)
+ def cli(database, user, host, port, socket, password, dbname,
+         version, verbose, prompt, logfile, defaults_group_suffix,
+@@ -1058,7 +1060,8 @@ def cli(database, user, host, port, socket, password, dbname,
+         ssl_ca, ssl_capath, ssl_cert, ssl_key, ssl_cipher,
+         ssl_verify_server_cert, table, csv, warn, execute, myclirc, dsn,
+         list_dsn, ssh_user, ssh_host, ssh_port, ssh_password,
+-        ssh_key_filename, list_ssh_config, ssh_config_path, ssh_config_host):
++        ssh_key_filename, list_ssh_config, ssh_config_path, ssh_config_host,
++        init_command):
+     """A MySQL terminal client with auto-completion and syntax highlighting.
+ 
+     \b
+@@ -1182,7 +1185,8 @@ def cli(database, user, host, port, socket, password, dbname,
+         ssh_host=ssh_host,
+         ssh_port=ssh_port,
+         ssh_password=ssh_password,
+-        ssh_key_filename=ssh_key_filename
++        ssh_key_filename=ssh_key_filename,
++        init_command=init_command
+     )
+ 
+     mycli.logger.debug('Launch Params: \n'
+diff --git a/mycli/myclirc b/mycli/myclirc
+index 534b201..ba3ea1e 100644
+--- a/mycli/myclirc
++++ b/mycli/myclirc
+@@ -111,6 +111,7 @@ bottom-toolbar.transaction.failed = 'bg:#222222 #ff005f bold'
+ output.header = "#00ff5f bold"
+ output.odd-row = ""
+ output.even-row = ""
++output.null = "#808080"
+ 
+ # Favorite queries.
+ [favorite_queries]
+diff --git a/mycli/packages/completion_engine.py b/mycli/packages/completion_engine.py
+index 2b19c32..3cff2cc 100644
+--- a/mycli/packages/completion_engine.py
++++ b/mycli/packages/completion_engine.py
+@@ -2,7 +2,6 @@ import os
+ import sys
+ import sqlparse
+ from sqlparse.sql import Comparison, Identifier, Where
+-from sqlparse.compat import text_type
+ from .parseutils import last_word, extract_tables, find_prev_keyword
+ from .special import parse_special_command
+ 
+@@ -55,7 +54,7 @@ def suggest_type(full_text, text_before_cursor):
+         stmt_start, stmt_end = 0, 0
+ 
+         for statement in parsed:
+-            stmt_len = len(text_type(statement))
++            stmt_len = len(str(statement))
+             stmt_start, stmt_end = stmt_end, stmt_end + stmt_len
+ 
+             if stmt_end >= current_pos:
+diff --git a/mycli/sqlexecute.py b/mycli/sqlexecute.py
+index c68af0f..7534982 100644
+--- a/mycli/sqlexecute.py
++++ b/mycli/sqlexecute.py
+@@ -42,7 +42,7 @@ class SQLExecute(object):
+ 
+     def __init__(self, database, user, password, host, port, socket, charset,
+                  local_infile, ssl, ssh_user, ssh_host, ssh_port, ssh_password,
+-                 ssh_key_filename):
++                 ssh_key_filename, init_command=None):
+         self.dbname = database
+         self.user = user
+         self.password = password
+@@ -59,12 +59,13 @@ class SQLExecute(object):
+         self.ssh_port = ssh_port
+         self.ssh_password = ssh_password
+         self.ssh_key_filename = ssh_key_filename
++        self.init_command = init_command
+         self.connect()
+ 
+     def connect(self, database=None, user=None, password=None, host=None,
+                 port=None, socket=None, charset=None, local_infile=None,
+                 ssl=None, ssh_host=None, ssh_port=None, ssh_user=None,
+-                ssh_password=None, ssh_key_filename=None):
++                ssh_password=None, ssh_key_filename=None, init_command=None):
+         db = (database or self.dbname)
+         user = (user or self.user)
+         password = (password or self.password)
+@@ -79,6 +80,7 @@ class SQLExecute(object):
+         ssh_port = (ssh_port or self.ssh_port)
+         ssh_password = (ssh_password or self.ssh_password)
+         ssh_key_filename = (ssh_key_filename or self.ssh_key_filename)
++        init_command = (init_command or self.init_command)
+         _logger.debug(
+             'Connection DB Params: \n'
+             '\tdatabase: %r'
+@@ -93,9 +95,11 @@ class SQLExecute(object):
+             '\tssh_host: %r'
+             '\tssh_port: %r'
+             '\tssh_password: %r'
+-            '\tssh_key_filename: %r',
++            '\tssh_key_filename: %r'
++            '\tinit_command: %r',
+             db, user, host, port, socket, charset, local_infile, ssl,
+-            ssh_user, ssh_host, ssh_port, ssh_password, ssh_key_filename
++            ssh_user, ssh_host, ssh_port, ssh_password, ssh_key_filename,
++            init_command
+         )
+         conv = conversions.copy()
+         conv.update({
+@@ -110,12 +114,16 @@ class SQLExecute(object):
+         if ssh_host:
+             defer_connect = True
+ 
++        client_flag = pymysql.constants.CLIENT.INTERACTIVE
++        if init_command and len(list(special.split_queries(init_command))) > 1:
++            client_flag |= pymysql.constants.CLIENT.MULTI_STATEMENTS
++
+         conn = pymysql.connect(
+             database=db, user=user, password=password, host=host, port=port,
+             unix_socket=socket, use_unicode=True, charset=charset,
+-            autocommit=True, client_flag=pymysql.constants.CLIENT.INTERACTIVE,
++            autocommit=True, client_flag=client_flag,
+             local_infile=local_infile, conv=conv, ssl=ssl, program_name="mycli",
+-            defer_connect=defer_connect
++            defer_connect=defer_connect, init_command=init_command
+         )
+ 
+         if ssh_host:
+@@ -146,6 +154,7 @@ class SQLExecute(object):
+         self.socket = socket
+         self.charset = charset
+         self.ssl = ssl
++        self.init_command = init_command
+         # retrieve connection id
+         self.reset_connection_id()
+ 
+diff --git a/requirements-dev.txt b/requirements-dev.txt
+index 8e206a5..7a38ed5 100644
+--- a/requirements-dev.txt
++++ b/requirements-dev.txt
+@@ -3,8 +3,8 @@ pytest!=3.3.0
+ pytest-cov==2.4.0
+ tox
+ twine==1.12.1
+-behave
+-pexpect
++behave>=1.2.4
++pexpect==3.3
+ coverage==5.0.4
+ codecov==2.0.9
+ autopep8==1.3.3
+diff --git a/setup.py b/setup.py
+index 156cd1a..fbab22e 100755
+--- a/setup.py
++++ b/setup.py
+@@ -24,7 +24,7 @@ install_requirements = [
+     'sqlparse>=0.3.0,<0.4.0',
+     'configobj >= 5.0.5',
+     'cryptography >= 1.0.0',
+-    'cli_helpers[styles] > 1.1.0',
++    'cli_helpers[styles] >= 2.0.1',
+ ]
+ 
+ 
+@@ -65,7 +65,7 @@ class test(TestCommand):
+     def initialize_options(self):
+         TestCommand.initialize_options(self)
+         self.pytest_args = ''
+-        self.behave_args = ''
++        self.behave_args = '--no-capture'
+ 
+     def run_tests(self):
+         unit_test_errno = subprocess.call(
+diff --git a/test/features/environment.py b/test/features/environment.py
+index 1a49dbe..cb35140 100644
+--- a/test/features/environment.py
++++ b/test/features/environment.py
+@@ -16,7 +16,7 @@ def before_all(context):
+     os.environ['LINES'] = "100"
+     os.environ['COLUMNS'] = "100"
+     os.environ['EDITOR'] = 'ex'
+-    os.environ['LC_ALL'] = 'en_US.utf8'
++    os.environ['LC_ALL'] = 'en_US.UTF-8'
+     os.environ['PROMPT_TOOLKIT_NO_CPR'] = '1'
+ 
+     test_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
+@@ -118,11 +118,12 @@ def after_scenario(context, _):
+             host = context.conf['host']
+             dbname = context.currentdb
+             context.cli.expect_exact(
+-                '{0}@{1}:{2}> '.format(
++                '{0}@{1}:{2}>'.format(
+                     user, host, dbname
+                 ),
+                 timeout=5
+             )
++        context.cli.sendcontrol('c')
+         context.cli.sendcontrol('d')
+         context.cli.expect_exact(pexpect.EOF, timeout=5)
+ 
+diff --git a/test/features/steps/crud_database.py b/test/features/steps/crud_database.py
+index a0bfa53..be6dec0 100644
+--- a/test/features/steps/crud_database.py
++++ b/test/features/steps/crud_database.py
+@@ -64,15 +64,13 @@ def step_see_prompt(context):
+     user = context.conf['user']
+     host = context.conf['host']
+     dbname = context.currentdb
+-    wrappers.expect_exact(context, '{0}@{1}:{2}> '.format(
+-        user, host, dbname), timeout=5)
+-    context.atprompt = True
++    wrappers.wait_prompt(context, '{0}@{1}:{2}> '.format(user, host, dbname))
+ 
+ 
+ @then('we see help output')
+ def step_see_help(context):
+     for expected_line in context.fixture_data['help_commands.txt']:
+-        wrappers.expect_exact(context, expected_line + '\r\n', timeout=1)
++        wrappers.expect_exact(context, expected_line, timeout=1)
+ 
+ 
+ @then('we see database created')
+@@ -96,10 +94,7 @@ def step_see_db_dropped_no_default(context):
+     context.currentdb = None
+ 
+     wrappers.expect_exact(context, 'Query OK, 0 rows affected', timeout=2)
+-    wrappers.expect_exact(context, '{0}@{1}:{2}> '.format(
+-        user, host, database), timeout=5)
+-
+-    context.atprompt = True
++    wrappers.wait_prompt(context, '{0}@{1}:{2}>'.format(user, host, database))
+ 
+ 
+ @then('we see database connected')
+diff --git a/test/features/steps/wrappers.py b/test/features/steps/wrappers.py
+index 565ca59..de833dd 100644
+--- a/test/features/steps/wrappers.py
++++ b/test/features/steps/wrappers.py
+@@ -88,7 +88,7 @@ def wait_prompt(context, prompt=None):
+         user = context.conf['user']
+         host = context.conf['host']
+         dbname = context.currentdb
+-        prompt = '{0}@{1}:{2}> '.format(
++        prompt = '{0}@{1}:{2}>'.format(
+             user, host, dbname),
+     expect_exact(context, prompt, timeout=5)
+     context.atprompt = True
+diff --git a/test/test_main.py b/test/test_main.py
+index 3f92bd1..707c359 100644
+--- a/test/test_main.py
++++ b/test/test_main.py
+@@ -492,3 +492,37 @@ def test_ssh_config(monkeypatch):
+             MockMyCli.connect_args["ssh_host"] == "arg_host" and \
+             MockMyCli.connect_args["ssh_port"] == 3 and \
+             MockMyCli.connect_args["ssh_key_filename"] == "/path/to/key"
++
++
++@dbtest
++def test_init_command_arg(executor):
++    init_command = "set sql_select_limit=1000"
++    sql = 'show variables like "sql_select_limit";'
++    runner = CliRunner()
++    result = runner.invoke(
++        cli, args=CLI_ARGS + ["--init-command", init_command], input=sql
++    )
++
++    expected = "sql_select_limit\t1000\n"
++    assert result.exit_code == 0
++    assert expected in result.output
++
++
++@dbtest
++def test_init_command_multiple_arg(executor):
++    init_command = 'set sql_select_limit=2000; set max_join_size=20000'
++    sql = (
++        'show variables like "sql_select_limit";\n'
++        'show variables like "max_join_size"'
++    )
++    runner = CliRunner()
++    result = runner.invoke(
++        cli, args=CLI_ARGS + ['--init-command', init_command], input=sql
++    )
++
++    expected_sql_select_limit = 'sql_select_limit\t2000\n'
++    expected_max_join_size = 'max_join_size\t20000\n'
++
++    assert result.exit_code == 0
++    assert expected_sql_select_limit in result.output
++    assert expected_max_join_size in result.output
+diff --git a/test/test_tabular_output.py b/test/test_tabular_output.py
+index 7d7d000..c20c7de 100644
+--- a/test/test_tabular_output.py
++++ b/test/test_tabular_output.py
+@@ -16,7 +16,7 @@ from pymysql.constants import FIELD_TYPE
+ @pytest.fixture
+ def mycli():
+     cli = MyCli()
+-    cli.connect(None, USER, PASSWORD, HOST, PORT, None)
++    cli.connect(None, USER, PASSWORD, HOST, PORT, None, init_command=None)
+     return cli
+ 
+ 

diff --git a/dev-db/mycli/mycli-1.22.2_p20201026.ebuild b/dev-db/mycli/mycli-1.22.2_p20201026.ebuild
new file mode 100644
index 00000000000..45cb7e841de
--- /dev/null
+++ b/dev-db/mycli/mycli-1.22.2_p20201026.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python{3_6,3_7,3_8} )
+DISTUTILS_SINGLE_IMPL=yes
+DISTUTILS_USE_SETUPTOOLS=rdepend
+inherit distutils-r1
+
+MY_PV=$(ver_cut 1-3)
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+DESCRIPTION="CLI for MySQL Database with auto-completion and syntax highlighting"
+
+HOMEPAGE="https://www.mycli.net"
+SRC_URI="https://github.com/dbcli/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
+LICENSE="BSD MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="ssh test"
+RESTRICT="!test? ( test )"
+RDEPEND="$(python_gen_cond_dep '
+	>=dev-python/cli_helpers-2.0.1[${PYTHON_USEDEP}]
+	>=dev-python/click-7.0[${PYTHON_USEDEP}]
+	>=dev-python/configobj-5.0.6[${PYTHON_USEDEP}]
+	>=dev-python/cryptography-1.0.0[${PYTHON_USEDEP}]
+	>=dev-python/prompt_toolkit-3.0.0[${PYTHON_USEDEP}]
+	<dev-python/prompt_toolkit-4.0.0[${PYTHON_USEDEP}]
+	>=dev-python/pygments-2.0[${PYTHON_USEDEP}]
+	>=dev-python/pymysql-0.9.2[${PYTHON_USEDEP}]
+	>=dev-python/sqlparse-0.3.0[${PYTHON_USEDEP}]
+	<dev-python/sqlparse-0.5.0[${PYTHON_USEDEP}]
+	ssh? ( dev-python/paramiko[${PYTHON_USEDEP}] )')
+"
+DEPEND="${RDEPEND}"
+BDEPEND="test? ( $(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]') )"
+
+distutils_enable_tests pytest
+
+PATCHES=( "${FILESDIR}/mycli-1.21.1-fix-test-install.patch" "${FILESDIR}/mycli-1.22.2_p20201026.patch" )
+
+python_test() {
+	pytest --capture=sys \
+		--showlocals \
+		--doctest-modules \
+		--doctest-ignore-import-errors \
+		--ignore=setup.py \
+		--ignore=mycli/magic.py \
+		--ignore=mycli/packages/parseutils.py \
+		--ignore=test/features \
+		--ignore=mycli/packages/paramiko_stub/__init__.py
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-db/mycli/files/, dev-db/mycli/
@ 2024-05-01 17:44 Michał Górny
  0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2024-05-01 17:44 UTC (permalink / raw
  To: gentoo-commits

commit:     e11504e466474c1b233ad94e018fe346791cd586
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed May  1 17:34:32 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed May  1 17:34:32 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e11504e4

dev-db/mycli: Remove old

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-db/mycli/Manifest                              |  1 -
 .../files/mycli-1.21.1-fix-test-install.patch      | 11 ---
 dev-db/mycli/mycli-1.27.0.ebuild                   | 82 ----------------------
 3 files changed, 94 deletions(-)

diff --git a/dev-db/mycli/Manifest b/dev-db/mycli/Manifest
index cf298dd7c563..ffedc59bb7eb 100644
--- a/dev-db/mycli/Manifest
+++ b/dev-db/mycli/Manifest
@@ -1,2 +1 @@
-DIST mycli-1.27.0.gh.tar.gz 285739 BLAKE2B 9b3ba8b98289721774d7bf06465402440d70772ee4f456f1a14a02a0f0cf90e6c4e6fe2abe36436ea051042bed208868dc469e9ef7c4499a9fdacd519b119199 SHA512 ae6fa9ed9151a39988ea64c5d551a68c92014cbaae4ec6695a727cd008882298d3373d1992768eff0781e881738f72f00dfe4756196c0ba82009758b1ea16b51
 DIST mycli-1.27.2.gh.tar.gz 286537 BLAKE2B 7bff978f9a08561c33f5327f13b8b69226e5c735527a607190a3c5d75f091b9f76b8d432e7a3e315ff250995e0baea7f7e0bede17e0b1cc6654939b7ec82b0ae SHA512 fdf0342b0e850b5232c815e73f44f22c7ea162201588681ccf2f4107b84b87f01fff3999a9720fef454239192356f074f47642ddc760af18973a2aaaac4676cd

diff --git a/dev-db/mycli/files/mycli-1.21.1-fix-test-install.patch b/dev-db/mycli/files/mycli-1.21.1-fix-test-install.patch
deleted file mode 100644
index 7c802a803337..000000000000
--- a/dev-db/mycli/files/mycli-1.21.1-fix-test-install.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/setup.py	2020-04-19 16:15:15.000000000 -0400
-+++ b/setup.py	2020-07-07 13:56:25.181039348 -0400
-@@ -85,7 +85,7 @@
-     author_email='mycli-dev@googlegroups.com',
-     version=version,
-     url='http://mycli.net',
--    packages=find_packages(),
-+    packages=find_packages(exclude=["*.test","*.test.*","test.*","test"]),
-     package_data={'mycli': ['myclirc', 'AUTHORS', 'SPONSORS']},
-     description=description,
-     long_description=description,

diff --git a/dev-db/mycli/mycli-1.27.0.ebuild b/dev-db/mycli/mycli-1.27.0.ebuild
deleted file mode 100644
index 6e6fd4275fc0..000000000000
--- a/dev-db/mycli/mycli-1.27.0.ebuild
+++ /dev/null
@@ -1,82 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DISTUTILS_SINGLE_IMPL=yes
-DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{10..12} )
-
-inherit distutils-r1
-
-DESCRIPTION="CLI for MySQL Database with auto-completion and syntax highlighting"
-HOMEPAGE="
-	https://www.mycli.net/
-	https://github.com/dbcli/mycli/
-	https://pypi.org/project/mycli/
-"
-SRC_URI="
-	https://github.com/dbcli/mycli/archive/v${PV}.tar.gz
-		-> ${P}.gh.tar.gz
-"
-
-LICENSE="BSD MIT"
-SLOT="0"
-KEYWORDS="~amd64 ~arm64 ~x86"
-IUSE="ssh"
-
-RDEPEND="
-	$(python_gen_cond_dep '
-		>=dev-python/cli-helpers-2.2.1[${PYTHON_USEDEP}]
-		>=dev-python/click-7.0[${PYTHON_USEDEP}]
-		>=dev-python/configobj-5.0.5[${PYTHON_USEDEP}]
-		>=dev-python/cryptography-1.0.0[${PYTHON_USEDEP}]
-		>=dev-python/prompt-toolkit-3.0.6[${PYTHON_USEDEP}]
-		<dev-python/prompt-toolkit-4.0.0[${PYTHON_USEDEP}]
-		>=dev-python/pyaes-1.6.1[${PYTHON_USEDEP}]
-		>=dev-python/pygments-1.6[${PYTHON_USEDEP}]
-		>=dev-python/pymysql-0.9.2[${PYTHON_USEDEP}]
-		>=dev-python/pyperclip-1.8.1[${PYTHON_USEDEP}]
-		>=dev-python/sqlglot-5.1.3[${PYTHON_USEDEP}]
-		>=dev-python/sqlparse-0.3.0[${PYTHON_USEDEP}]
-		<dev-python/sqlparse-0.5.0[${PYTHON_USEDEP}]
-		ssh? ( dev-python/paramiko[${PYTHON_USEDEP}] )'
-	)
-"
-BDEPEND="
-	test? (
-		$(python_gen_cond_dep '
-			dev-python/paramiko[${PYTHON_USEDEP}]
-		')
-	)
-"
-
-EPYTEST_DESELECT=(
-	# Fails after a seemingly benign change in sqlparse 0.4.3
-	# https://github.com/dbcli/mycli/issues/1103
-	"test/test_smart_completion_public_schema_only.py::test_auto_escaped_col_names"
-	# Requires a running mysql daemon
-	"test/test_main.py::test_batch"
-	"test/test_main.py::test_execute"
-	"test/test_main.py::test_init"
-	"test/test_special_iocommands.py::test_favorite_query"
-	"test/test_special_iocommands.py::test_watch"
-	"test/test_tabular_output.py::test_sql_output"
-)
-
-EPYTEST_IGNORE=(
-	# Requires a running mysql daemon
-	"test/test_sqlexecute.py"
-)
-
-distutils_enable_tests pytest
-
-PATCHES=( "${FILESDIR}/mycli-1.21.1-fix-test-install.patch" )
-
-src_prepare() {
-	default
-
-	# Remove unnecessary pin, we have paramiko 3.2.0.
-	# https://github.com/dbcli/mycli/commit/eaddc5ca3e208d66fd4f400b90eb76089dd35e4c
-	sed -i -e 's:==:>=:' setup.py || die
-}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-01 17:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-01 17:44 [gentoo-commits] repo/gentoo:master commit in: dev-db/mycli/files/, dev-db/mycli/ Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2020-12-07 19:44 Brian Evans
2019-08-23 14:10 Brian Evans
2017-12-27 15:19 Brian Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox