dev-python/mysqlclient: Bump to 2.2.6

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2024-11-13 10:16:00 +01:00
parent e7cdb0a5fc
commit 10fa33f517
2 changed files with 94 additions and 0 deletions

View File

@@ -1 +1,2 @@
DIST mysqlclient-2.2.4.tar.gz 90400 BLAKE2B b41ed12bd8b2ea49b34d038db93e599eb05c9a910ab712fc8b7feed918f83bf3c4c8e55eac45ee944edefc26b0610b19cee9e9b76450adf9981ecc9b5fa44d85 SHA512 d1f7ba693368309a14a0982c2f1e0731617b482044afab765c8d81ea26dc6950a110c6cab48792ea1397add7b7151c756d5d22827fcce836404456f8956538a6
DIST mysqlclient-2.2.6.tar.gz 91055 BLAKE2B e515e693100135404bf00a41b7fe0364c8276ee1be847b22ef014bb01ef065a0bbb12cb2becbdb27a1b2a9528d43c668ba36ec25f8b43adffcc5762ed641a011 SHA512 cb5f9e8e0c8bfc8d1360a3ca03d6961b4e083ce25727d0340727e3d70816d37147ebce8507eb1a2c42e093b63ba375f9806958834c0703abe7c27908c7a094d1

View File

@@ -0,0 +1,93 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_EXT=1
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{10..13} )
inherit distutils-r1 pypi
DESCRIPTION="Python interface to MySQL"
HOMEPAGE="
https://pypi.org/project/mysqlclient/
https://github.com/PyMySQL/mysqlclient/
"
LICENSE="GPL-2+"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
DEPEND="
dev-db/mysql-connector-c:0=
"
RDEPEND="
${DEPEND}
"
BDEPEND="
test? (
dev-db/mariadb[server]
)
"
distutils_enable_sphinx doc \
dev-python/sphinx-rtd-theme
distutils_enable_tests pytest
src_test() {
rm -r src || die
local datadir="${T}/mysql" \
install_log="${T}/mysqld_install.log" \
pidfile="${T}/mysqld.pid" \
socket="${T}/mysqld.sock" \
log="${T}/mysqld.log"
einfo "Creating test MySQL instance ..."
if ! mysql_install_db \
--no-defaults \
--auth-root-authentication-method=normal \
--basedir="${EPREFIX}/usr" \
--datadir="${datadir}" >& "${install_log}"
then
cat "${install_log}"
die "Failed to create database"
fi
einfo "Starting test MySQL instance ..."
mysqld \
--no-defaults \
--character-set-server=utf8 \
--pid-file="${pidfile}" \
--socket="${socket}" \
--skip-networking \
--datadir="${datadir}" >& "${log}" &
local i timeout=10
einfo "Waiting for MySQL to start for up to ${timeout} seconds ..."
for i in seq 1 ${timeout}; do
[[ -S "${socket}" ]] && break
sleep 1
done
if [[ ! -S "${socket}" ]]; then
cat "${log}"
die "MySQL failed to start in ${timeout} seconds"
fi
cat > "${T}/mysql.cnf" <<- EOF
[MySQLdb-tests]
socket = ${socket}
user = root
database = test
EOF
distutils-r1_src_test
einfo "Stopping test MySQL instance ..."
pkill -F "${pidfile}" &>/dev/null
}
python_test() {
local -x TESTDB="${T}/mysql.cnf"
epytest
}