summaryrefslogtreecommitdiff
path: root/dev-db/mycli
diff options
context:
space:
mode:
authorroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
committerroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
commitb590c8d7572b727d565cc0b8ff660d43569845de (patch)
tree06f7a4102ea4e845df8b66660f252920d52952f9 /dev-db/mycli
parent24f9cbfc4c34fdb6a6e03311674414e881ceab47 (diff)
downloadbaldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.gz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.xz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.zip
Adding metadata
Diffstat (limited to 'dev-db/mycli')
-rw-r--r--dev-db/mycli/Manifest6
-rw-r--r--dev-db/mycli/metadata.xml17
-rw-r--r--dev-db/mycli/mycli-1.65.0.ebuild190
-rw-r--r--dev-db/mycli/mycli-1.71.0.ebuild190
-rw-r--r--dev-db/mycli/mycli-1.72.1.ebuild190
5 files changed, 593 insertions, 0 deletions
diff --git a/dev-db/mycli/Manifest b/dev-db/mycli/Manifest
new file mode 100644
index 000000000000..c10fe2e09e9b
--- /dev/null
+++ b/dev-db/mycli/Manifest
@@ -0,0 +1,6 @@
+DIST mycli-1.65.0.tar.gz 358883 BLAKE2B f155547301dc01fd3e2546dc662998f7f9c2bb301a0b8081b7eac1078782a879d0f96854ca50be298a144ca292b9a119032890091115c76726811621faa8bab6 SHA512 fcd58c72cc0d98c58467e90e566f79d1ce4693ce79b0be49203a547f3a92f0818ba04ebfc8c0822a5807e37701ec1345d785bd01e1d5fad1258f28d188b375f8
+DIST mycli-1.65.0.tar.gz.provenance 9484 BLAKE2B f9af01db05dac0a069e3a5da5ccb9c3741079f21c6f3d0dcc07eb475d672aa6ecd83eb992f3f8c8fa42ca5b4d1d6707d961012a4677f9f9244a5fcf2fda71fbb SHA512 0d1418fd257a7efab78f1266eb166b37669c9fa308b93c1f84ffe967e74d83da33cf7265930329296fed5ae5161107edb207780922961251b81df0220035422d
+DIST mycli-1.71.0.tar.gz 464366 BLAKE2B b5af6a2323b41ad47475868d63c04c3c150fe6a07b523679a9458dc628a9a287c16a60d878e2fed9b85c39f81f7f2d60900705deb42c271a58bbf05ae7235894 SHA512 b9b657b53e2e3c72ab6c272420aa866db8dd9d1052769fe16d7d070079bb3b46b743f288b8037b12f530de3f3567cd819c8538345f2c2474325785187909203a
+DIST mycli-1.71.0.tar.gz.provenance 9318 BLAKE2B ed936ceff7191091c04b0fc32b1212b069328f25269efc36315b61990a796d104d290c176aa0a914bf7a0eea3105bed2b8964334fc1d92ba3182ec6e92b5725b SHA512 7ed5b00309a87c7e63602f3934780a16da2873496be783e3290e501f4900aad0c43be4dc093c5603cd676be36cc25b7c035de722816fb69c329a99a71c76dec4
+DIST mycli-1.72.1.tar.gz 465979 BLAKE2B b6b98f23fee288cd5d57b32ea3862e7602d2b8999155d990d5a0dd5472aca744045f9609f0530806a6d3c27195729dee50845e483b4965e524f0e185be8e028e SHA512 0e7c22604e2f3baa49fd9969ecf71213eeb44bb704d372798e25955a230165454b5067ed2f0877831dc387e5ac541ad2d1485e34710b83bbf749fd4be26f5b2a
+DIST mycli-1.72.1.tar.gz.provenance 9365 BLAKE2B ebff7eb277b8fa7b9ff1e690d70ec3f3aad4d2d81bf90908a7e0722b2ed3c25e1ff5d4779e96be7d6c16b1966f6305b131e5a4c49a7245c62231083edc064220 SHA512 69644eed8cfcee8d545d4e9178a922b9f752206ee6069a5e892ac91c0d62f7e58e3d28a2e65f42e8ffae0a6d7b6ab810114c4da6c18a96c6507ab793fc1b90a3
diff --git a/dev-db/mycli/metadata.xml b/dev-db/mycli/metadata.xml
new file mode 100644
index 000000000000..e9a159c44fac
--- /dev/null
+++ b/dev-db/mycli/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>parona@protonmail.com</email>
+ <name>Alfred Wingate</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <stabilize-allarches />
+ <use>
+ <flag name="ssh">Add support for connection over SSH tunnel</flag>
+ </use>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/dev-db/mycli/mycli-1.65.0.ebuild b/dev-db/mycli/mycli-1.65.0.ebuild
new file mode 100644
index 000000000000..4cffa2bf7b6c
--- /dev/null
+++ b/dev-db/mycli/mycli-1.65.0.ebuild
@@ -0,0 +1,190 @@
+# Copyright 1999-2026 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_{13..14} )
+PYPI_VERIFY_REPO=https://github.com/dbcli/mycli
+inherit distutils-r1 edo eapi9-ver multiprocessing pypi
+
+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/
+"
+
+LICENSE="BSD MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64"
+
+# optional llm unpackaged
+IUSE="ssh"
+
+# ~paramiko-3.5.1: Pinned due to breakage. Feature soft deprecated for future removal
+# https://github.com/dbcli/mycli/commit/82c7d92a16ad15906c46df14cc6e6ee0249609e6
+# https://github.com/dbcli/mycli/issues/1464
+RDEPEND="
+ $(python_gen_cond_dep '
+ >=dev-python/cli-helpers-2.11.0[${PYTHON_USEDEP}]
+ >=dev-python/click-8.3.1[${PYTHON_USEDEP}]
+ >=dev-python/configobj-5.0.9[${PYTHON_USEDEP}]
+ >=dev-python/cryptography-46.0.5[${PYTHON_USEDEP}]
+ >=dev-python/keyring-25.7.0[${PYTHON_USEDEP}]
+ >=dev-python/prompt-toolkit-3.0.6[${PYTHON_USEDEP}]
+ <dev-python/prompt-toolkit-4.0.0[${PYTHON_USEDEP}]
+ >=dev-python/pycryptodome-3.23.0[${PYTHON_USEDEP}]
+ >=dev-python/pyfzf-0.3.1[${PYTHON_USEDEP}]
+ >=dev-python/pygments-2.19.2[${PYTHON_USEDEP}]
+ >=dev-python/pymysql-1.1.2[${PYTHON_USEDEP}]
+ >=dev-python/pyperclip-1.11.0[${PYTHON_USEDEP}]
+ >=dev-python/rapidfuzz-3.14.3[${PYTHON_USEDEP}]
+ >=dev-python/sqlglot-29.0.1[${PYTHON_USEDEP}]
+ <dev-python/sqlparse-0.6.0[${PYTHON_USEDEP}]
+ >=dev-python/sqlparse-0.3.0[${PYTHON_USEDEP}]
+ >=dev-python/wcwidth-0.6.0[${PYTHON_USEDEP}]
+ ssh? (
+ ~dev-python/paramiko-3.5.1[${PYTHON_USEDEP}]
+ dev-python/sshtunnel[${PYTHON_USEDEP}]
+ )
+ ')
+"
+BDEPEND="
+ $(python_gen_cond_dep '
+ dev-python/setuptools-scm[${PYTHON_USEDEP}]
+ test? (
+ dev-db/mysql[server]
+ >=dev-python/behave-1.3.3[${PYTHON_USEDEP}]
+ ~dev-python/paramiko-3.5.1[${PYTHON_USEDEP}]
+ >=dev-python/pexpect-4.9.0[${PYTHON_USEDEP}]
+ dev-python/sshtunnel[${PYTHON_USEDEP}]
+ )
+ ')
+"
+
+EPYTEST_PLUGINS=()
+distutils_enable_tests pytest
+
+export SETUPTOOLS_SCM_PRETEND_VERSION=${PV}
+
+python_prepare_all() {
+ # no coverage please
+ sed -e 's/import coverage ; coverage.process_startup(); //' \
+ -i test/features/environment.py test/features/steps/wrappers.py || die
+
+ # dont pin dependencies
+ sed -e '/^dependencies = \[/,/^\]$/ s/"\(.*\) ~=/"\1 >=/' \
+ -i pyproject.toml || die
+
+ # convert from pycryptodomex to pycryptodome
+ sed -e 's/pycryptodomex/pycryptodome/' -i pyproject.toml || die
+ sed -e 's/from Cryptodome/from Crypto/' -i mycli/config.py || die
+
+ # network-sandbox messes with these
+ sed -e '/run mycli on localhost without port/i @gentoo_skip' \
+ -e '/run mycli on TCP host without port/i @gentoo_skip' \
+ -e '/run mycli without host and port/i @gentoo_skip' \
+ -i test/features/connection.feature || die
+
+ # Requires an old school vi and the symlink for vi itself messes with this
+ sed -e '/edit sql in file with external editor/i @gentoo_skip' \
+ -i test/features/iocommands.feature || die
+
+ distutils-r1_python_prepare_all
+}
+
+src_test() {
+ # test/utils.py
+ local -x PYTEST_PASSWORD="notsecure"
+ local -x PYTEST_HOST="127.0.0.1"
+ local -x PYTEST_PORT="43307"
+ local -x PYTEST_CHARSET="utf8"
+
+ einfo "Creating mysql test instance ..."
+ mysqld \
+ --no-defaults \
+ --initialize-insecure \
+ --basedir="${EPREFIX}/usr" \
+ --datadir="${T}/mysql" 1>"${T}"/mysql_install.log || die
+
+ einfo "Starting mysql test instance ..."
+ mysqld \
+ --no-defaults \
+ --character-set-server="${PYTEST_CHARSET}" \
+ --bind-address="${PYTEST_HOST}" \
+ --port="${PYTEST_PORT}" \
+ --pid-file="${T}/mysqld.pid" \
+ --socket="${T}/mysqld.sock" \
+ --datadir="${T}/mysql" 1>"${T}/mysqld.log" 2>&1 &
+
+ # wait for it to start
+ local i
+ for (( i = 0; i < 10; i++ )); do
+ [[ -S ${T}/mysqld.sock ]] && break
+ sleep 1
+ done
+ [[ ! -S ${T}/mysqld.sock ]] && die "mysqld failed to start"
+
+ einfo "Configuring test mysql instance ..."
+ mysql \
+ -u root \
+ --socket="${T}/mysqld.sock" \
+ -e "ALTER USER 'root'@'localhost' IDENTIFIED BY '${PYTEST_PASSWORD}'" \
+ || die "Failed to change mysql user password"
+
+ EPYTEST_IGNORE=(
+ # Requires unpackaged llm
+ test/test_llm_special.py
+ # AssertionError: assert 8 in [4, 5, 6, 7]
+ # Per upstream: "...it is a flaky test at best."
+ # https://github.com/dbcli/mycli/commit/3d08910a366d4505a40e8a0fb36c210330723f18
+ test/test_special_iocommands.py::test_watch_query_full
+ )
+
+ local failures=()
+ if ! nonfatal distutils-r1_src_test ; then
+ failures+=( pytest )
+ fi
+
+ if ! nonfatal edo behave \
+ --jobs=$(get_makeopts_jobs) \
+ --summary --verbose \
+ --tags="not @gentoo_skip" \
+ test/features ; then
+ failures+=( behave )
+ fi
+
+ einfo "Stopping mysql test instance ..."
+ pkill -F "${T}"/mysqld.pid || die
+ # wait for it to stop
+ local i
+ for (( i = 0; i < 10; i++ )); do
+ [[ -S ${T}/mysqld.sock ]] || break
+ sleep 1
+ done
+
+ rm -rf "${T}"/mysql || die
+
+ if [[ ${#failures[@]} -gt 0 ]]; then
+ die "Tests failed: ${failures}"
+ fi
+}
+
+pkg_postinst() {
+ if use ssh && ver_replacing -lt 1.49; then
+ elog "The built-in SSH functionality has been soft deprecated in mycli."
+ elog "It may be removed upstream in a future release and even sooner"
+ elog "downstream in the ebuild due to the pinned paramiko dependency."
+ elog "See also https://github.com/dbcli/mycli/issues/1464"
+ elog ""
+ fi
+ if ver_replacing -lt 1.50; then
+ elog "Reading configuration from '.my.cnf' has been deprecated."
+ elog "Configuration should be done in '.myclirc' from now on,"
+ elog "and in the future '.my.cnf' will be ignored."
+ elog "See also https://github.com/dbcli/mycli/issues/1490"
+ elog ""
+ fi
+}
diff --git a/dev-db/mycli/mycli-1.71.0.ebuild b/dev-db/mycli/mycli-1.71.0.ebuild
new file mode 100644
index 000000000000..4cd1d7962da4
--- /dev/null
+++ b/dev-db/mycli/mycli-1.71.0.ebuild
@@ -0,0 +1,190 @@
+# Copyright 1999-2026 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_{13..14} )
+PYPI_VERIFY_REPO=https://github.com/dbcli/mycli
+inherit distutils-r1 edo eapi9-ver multiprocessing pypi
+
+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/
+"
+
+LICENSE="BSD MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+
+# optional llm unpackaged
+IUSE="ssh"
+
+# ~paramiko-3.5.1: Pinned due to breakage. Feature soft deprecated for future removal
+# https://github.com/dbcli/mycli/commit/82c7d92a16ad15906c46df14cc6e6ee0249609e6
+# https://github.com/dbcli/mycli/issues/1464
+RDEPEND="
+ $(python_gen_cond_dep '
+ >=dev-python/cli-helpers-2.14.0[${PYTHON_USEDEP}]
+ >=dev-python/click-8.3.1[${PYTHON_USEDEP}]
+ >=dev-python/clickdc-0.1.1[${PYTHON_USEDEP}]
+ >=dev-python/configobj-5.0.9[${PYTHON_USEDEP}]
+ >=dev-python/cryptography-46.0.5[${PYTHON_USEDEP}]
+ >=dev-python/keyring-25.7.0[${PYTHON_USEDEP}]
+ >=dev-python/prompt-toolkit-3.0.41[${PYTHON_USEDEP}]
+ <dev-python/prompt-toolkit-4.0.0[${PYTHON_USEDEP}]
+ >=dev-python/pycryptodome-3.23.0[${PYTHON_USEDEP}]
+ >=dev-python/pyfzf-0.3.1[${PYTHON_USEDEP}]
+ >=dev-python/pygments-2.19.2[${PYTHON_USEDEP}]
+ >=dev-python/pymysql-1.1.2[${PYTHON_USEDEP}]
+ >=dev-python/pyperclip-1.11.0[${PYTHON_USEDEP}]
+ >=dev-python/rapidfuzz-3.14.3[${PYTHON_USEDEP}]
+ >=dev-python/sqlglot-30.4.3[${PYTHON_USEDEP}]
+ <dev-python/sqlparse-0.6.0[${PYTHON_USEDEP}]
+ >=dev-python/sqlparse-0.3.0[${PYTHON_USEDEP}]
+ >=dev-python/wcwidth-0.6.0[${PYTHON_USEDEP}]
+ ssh? (
+ ~dev-python/paramiko-3.5.1[${PYTHON_USEDEP}]
+ dev-python/sshtunnel[${PYTHON_USEDEP}]
+ )
+ ')
+"
+BDEPEND="
+ $(python_gen_cond_dep '
+ dev-python/setuptools-scm[${PYTHON_USEDEP}]
+ test? (
+ dev-db/mysql[server]
+ >=dev-python/behave-1.3.3[${PYTHON_USEDEP}]
+ ~dev-python/paramiko-3.5.1[${PYTHON_USEDEP}]
+ >=dev-python/pexpect-4.9.0[${PYTHON_USEDEP}]
+ dev-python/sshtunnel[${PYTHON_USEDEP}]
+ )
+ ')
+"
+
+EPYTEST_PLUGINS=()
+distutils_enable_tests pytest
+
+export SETUPTOOLS_SCM_PRETEND_VERSION=${PV}
+
+python_prepare_all() {
+ # no coverage please
+ sed -e 's/import coverage ; coverage.process_startup(); //' \
+ -i test/features/environment.py test/features/steps/wrappers.py || die
+
+ # dont pin dependencies
+ sed -e '/^dependencies = \[/,/^\]$/ s/"\(.*\) ~=/"\1 >=/' \
+ -i pyproject.toml || die
+
+ # convert from pycryptodomex to pycryptodome
+ sed -e 's/pycryptodomex/pycryptodome/' -i pyproject.toml || die
+ sed -e 's/from Cryptodome/from Crypto/' -i mycli/config.py || die
+
+ # network-sandbox messes with these
+ sed -e '/run mycli on localhost without port/i @gentoo_skip' \
+ -e '/run mycli on TCP host without port/i @gentoo_skip' \
+ -e '/run mycli without host and port/i @gentoo_skip' \
+ -i test/features/connection.feature || die
+
+ # Requires an old school vi and the symlink for vi itself messes with this
+ sed -e '/edit sql in file with external editor/i @gentoo_skip' \
+ -i test/features/iocommands.feature || die
+
+ # avoid unpackaged pytest-random-order
+ sed -e "/^addopts =/ s/, '--random-order'//" -i pyproject.toml || die
+
+ distutils-r1_python_prepare_all
+}
+
+src_test() {
+ # test/utils.py
+ local -x PYTEST_PASSWORD="notsecure"
+ local -x PYTEST_HOST="127.0.0.1"
+ local -x PYTEST_PORT="43307"
+ local -x PYTEST_CHARSET="utf8"
+
+ einfo "Creating mysql test instance ..."
+ mysqld \
+ --no-defaults \
+ --initialize-insecure \
+ --basedir="${EPREFIX}/usr" \
+ --datadir="${T}/mysql" 1>"${T}"/mysql_install.log || die
+
+ einfo "Starting mysql test instance ..."
+ mysqld \
+ --no-defaults \
+ --character-set-server="${PYTEST_CHARSET}" \
+ --bind-address="${PYTEST_HOST}" \
+ --port="${PYTEST_PORT}" \
+ --pid-file="${T}/mysqld.pid" \
+ --socket="${T}/mysqld.sock" \
+ --datadir="${T}/mysql" 1>"${T}/mysqld.log" 2>&1 &
+
+ # wait for it to start
+ local i
+ for (( i = 0; i < 10; i++ )); do
+ [[ -S ${T}/mysqld.sock ]] && break
+ sleep 1
+ done
+ [[ ! -S ${T}/mysqld.sock ]] && die "mysqld failed to start"
+
+ einfo "Configuring test mysql instance ..."
+ mysql \
+ -u root \
+ --socket="${T}/mysqld.sock" \
+ -e "ALTER USER 'root'@'localhost' IDENTIFIED BY '${PYTEST_PASSWORD}'" \
+ || die "Failed to change mysql user password"
+
+ EPYTEST_IGNORE=(
+ # Requires unpackaged llm
+ test/pytests/test_special_llm.py
+ )
+
+ local failures=()
+ if ! nonfatal distutils-r1_src_test ; then
+ failures+=( pytest )
+ fi
+
+ if ! nonfatal edo behave \
+ --jobs=$(get_makeopts_jobs) \
+ --summary --verbose \
+ --tags="not @gentoo_skip" \
+ test/features ; then
+ failures+=( behave )
+ fi
+
+ einfo "Stopping mysql test instance ..."
+ pkill -F "${T}"/mysqld.pid || die
+ # wait for it to stop
+ local i
+ for (( i = 0; i < 10; i++ )); do
+ [[ -S ${T}/mysqld.sock ]] || break
+ sleep 1
+ done
+
+ rm -rf "${T}"/mysql || die
+
+ if [[ ${#failures[@]} -gt 0 ]]; then
+ die "Tests failed: ${failures}"
+ fi
+}
+
+pkg_postinst() {
+ if use ssh && ver_replacing -lt 1.49; then
+ elog "The built-in SSH functionality has been soft deprecated in mycli."
+ elog "It may be removed upstream in a future release and even sooner"
+ elog "downstream in the ebuild due to the pinned paramiko dependency."
+ elog "See also https://github.com/dbcli/mycli/issues/1464"
+ elog ""
+ fi
+ if ver_replacing -lt 1.50; then
+ elog "Reading configuration from '.my.cnf' has been deprecated."
+ elog "Configuration should be done in '.myclirc' from now on,"
+ elog "and in the future '.my.cnf' will be ignored."
+ elog "See also https://github.com/dbcli/mycli/issues/1490"
+ elog ""
+ fi
+}
diff --git a/dev-db/mycli/mycli-1.72.1.ebuild b/dev-db/mycli/mycli-1.72.1.ebuild
new file mode 100644
index 000000000000..4cd1d7962da4
--- /dev/null
+++ b/dev-db/mycli/mycli-1.72.1.ebuild
@@ -0,0 +1,190 @@
+# Copyright 1999-2026 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_{13..14} )
+PYPI_VERIFY_REPO=https://github.com/dbcli/mycli
+inherit distutils-r1 edo eapi9-ver multiprocessing pypi
+
+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/
+"
+
+LICENSE="BSD MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+
+# optional llm unpackaged
+IUSE="ssh"
+
+# ~paramiko-3.5.1: Pinned due to breakage. Feature soft deprecated for future removal
+# https://github.com/dbcli/mycli/commit/82c7d92a16ad15906c46df14cc6e6ee0249609e6
+# https://github.com/dbcli/mycli/issues/1464
+RDEPEND="
+ $(python_gen_cond_dep '
+ >=dev-python/cli-helpers-2.14.0[${PYTHON_USEDEP}]
+ >=dev-python/click-8.3.1[${PYTHON_USEDEP}]
+ >=dev-python/clickdc-0.1.1[${PYTHON_USEDEP}]
+ >=dev-python/configobj-5.0.9[${PYTHON_USEDEP}]
+ >=dev-python/cryptography-46.0.5[${PYTHON_USEDEP}]
+ >=dev-python/keyring-25.7.0[${PYTHON_USEDEP}]
+ >=dev-python/prompt-toolkit-3.0.41[${PYTHON_USEDEP}]
+ <dev-python/prompt-toolkit-4.0.0[${PYTHON_USEDEP}]
+ >=dev-python/pycryptodome-3.23.0[${PYTHON_USEDEP}]
+ >=dev-python/pyfzf-0.3.1[${PYTHON_USEDEP}]
+ >=dev-python/pygments-2.19.2[${PYTHON_USEDEP}]
+ >=dev-python/pymysql-1.1.2[${PYTHON_USEDEP}]
+ >=dev-python/pyperclip-1.11.0[${PYTHON_USEDEP}]
+ >=dev-python/rapidfuzz-3.14.3[${PYTHON_USEDEP}]
+ >=dev-python/sqlglot-30.4.3[${PYTHON_USEDEP}]
+ <dev-python/sqlparse-0.6.0[${PYTHON_USEDEP}]
+ >=dev-python/sqlparse-0.3.0[${PYTHON_USEDEP}]
+ >=dev-python/wcwidth-0.6.0[${PYTHON_USEDEP}]
+ ssh? (
+ ~dev-python/paramiko-3.5.1[${PYTHON_USEDEP}]
+ dev-python/sshtunnel[${PYTHON_USEDEP}]
+ )
+ ')
+"
+BDEPEND="
+ $(python_gen_cond_dep '
+ dev-python/setuptools-scm[${PYTHON_USEDEP}]
+ test? (
+ dev-db/mysql[server]
+ >=dev-python/behave-1.3.3[${PYTHON_USEDEP}]
+ ~dev-python/paramiko-3.5.1[${PYTHON_USEDEP}]
+ >=dev-python/pexpect-4.9.0[${PYTHON_USEDEP}]
+ dev-python/sshtunnel[${PYTHON_USEDEP}]
+ )
+ ')
+"
+
+EPYTEST_PLUGINS=()
+distutils_enable_tests pytest
+
+export SETUPTOOLS_SCM_PRETEND_VERSION=${PV}
+
+python_prepare_all() {
+ # no coverage please
+ sed -e 's/import coverage ; coverage.process_startup(); //' \
+ -i test/features/environment.py test/features/steps/wrappers.py || die
+
+ # dont pin dependencies
+ sed -e '/^dependencies = \[/,/^\]$/ s/"\(.*\) ~=/"\1 >=/' \
+ -i pyproject.toml || die
+
+ # convert from pycryptodomex to pycryptodome
+ sed -e 's/pycryptodomex/pycryptodome/' -i pyproject.toml || die
+ sed -e 's/from Cryptodome/from Crypto/' -i mycli/config.py || die
+
+ # network-sandbox messes with these
+ sed -e '/run mycli on localhost without port/i @gentoo_skip' \
+ -e '/run mycli on TCP host without port/i @gentoo_skip' \
+ -e '/run mycli without host and port/i @gentoo_skip' \
+ -i test/features/connection.feature || die
+
+ # Requires an old school vi and the symlink for vi itself messes with this
+ sed -e '/edit sql in file with external editor/i @gentoo_skip' \
+ -i test/features/iocommands.feature || die
+
+ # avoid unpackaged pytest-random-order
+ sed -e "/^addopts =/ s/, '--random-order'//" -i pyproject.toml || die
+
+ distutils-r1_python_prepare_all
+}
+
+src_test() {
+ # test/utils.py
+ local -x PYTEST_PASSWORD="notsecure"
+ local -x PYTEST_HOST="127.0.0.1"
+ local -x PYTEST_PORT="43307"
+ local -x PYTEST_CHARSET="utf8"
+
+ einfo "Creating mysql test instance ..."
+ mysqld \
+ --no-defaults \
+ --initialize-insecure \
+ --basedir="${EPREFIX}/usr" \
+ --datadir="${T}/mysql" 1>"${T}"/mysql_install.log || die
+
+ einfo "Starting mysql test instance ..."
+ mysqld \
+ --no-defaults \
+ --character-set-server="${PYTEST_CHARSET}" \
+ --bind-address="${PYTEST_HOST}" \
+ --port="${PYTEST_PORT}" \
+ --pid-file="${T}/mysqld.pid" \
+ --socket="${T}/mysqld.sock" \
+ --datadir="${T}/mysql" 1>"${T}/mysqld.log" 2>&1 &
+
+ # wait for it to start
+ local i
+ for (( i = 0; i < 10; i++ )); do
+ [[ -S ${T}/mysqld.sock ]] && break
+ sleep 1
+ done
+ [[ ! -S ${T}/mysqld.sock ]] && die "mysqld failed to start"
+
+ einfo "Configuring test mysql instance ..."
+ mysql \
+ -u root \
+ --socket="${T}/mysqld.sock" \
+ -e "ALTER USER 'root'@'localhost' IDENTIFIED BY '${PYTEST_PASSWORD}'" \
+ || die "Failed to change mysql user password"
+
+ EPYTEST_IGNORE=(
+ # Requires unpackaged llm
+ test/pytests/test_special_llm.py
+ )
+
+ local failures=()
+ if ! nonfatal distutils-r1_src_test ; then
+ failures+=( pytest )
+ fi
+
+ if ! nonfatal edo behave \
+ --jobs=$(get_makeopts_jobs) \
+ --summary --verbose \
+ --tags="not @gentoo_skip" \
+ test/features ; then
+ failures+=( behave )
+ fi
+
+ einfo "Stopping mysql test instance ..."
+ pkill -F "${T}"/mysqld.pid || die
+ # wait for it to stop
+ local i
+ for (( i = 0; i < 10; i++ )); do
+ [[ -S ${T}/mysqld.sock ]] || break
+ sleep 1
+ done
+
+ rm -rf "${T}"/mysql || die
+
+ if [[ ${#failures[@]} -gt 0 ]]; then
+ die "Tests failed: ${failures}"
+ fi
+}
+
+pkg_postinst() {
+ if use ssh && ver_replacing -lt 1.49; then
+ elog "The built-in SSH functionality has been soft deprecated in mycli."
+ elog "It may be removed upstream in a future release and even sooner"
+ elog "downstream in the ebuild due to the pinned paramiko dependency."
+ elog "See also https://github.com/dbcli/mycli/issues/1464"
+ elog ""
+ fi
+ if ver_replacing -lt 1.50; then
+ elog "Reading configuration from '.my.cnf' has been deprecated."
+ elog "Configuration should be done in '.myclirc' from now on,"
+ elog "and in the future '.my.cnf' will be ignored."
+ elog "See also https://github.com/dbcli/mycli/issues/1490"
+ elog ""
+ fi
+}