summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2023-12-14 14:20:16 +0100
committerMichał Górny <mgorny@gentoo.org>2023-12-14 14:58:00 +0100
commitb7140e06526dc408cde44f9947aaceedf65be1ad (patch)
treeea093a29fc51bff9de688f22a67eff2bae09a77a /dev-python/mysqlclient
parentdev-python/cherrypy: Bump to 18.9.0 (diff)
downloadgentoo-b7140e06526dc408cde44f9947aaceedf65be1ad.tar.gz
gentoo-b7140e06526dc408cde44f9947aaceedf65be1ad.tar.bz2
gentoo-b7140e06526dc408cde44f9947aaceedf65be1ad.zip
dev-python/mysqlclient: Bump to 2.2.1
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/mysqlclient')
-rw-r--r--dev-python/mysqlclient/Manifest1
-rw-r--r--dev-python/mysqlclient/mysqlclient-2.2.1.ebuild92
2 files changed, 93 insertions, 0 deletions
diff --git a/dev-python/mysqlclient/Manifest b/dev-python/mysqlclient/Manifest
index d46a11d00ae7..cb6466c28227 100644
--- a/dev-python/mysqlclient/Manifest
+++ b/dev-python/mysqlclient/Manifest
@@ -1 +1,2 @@
DIST mysqlclient-2.2.0.tar.gz 89543 BLAKE2B 1e75d37825b81300103d980174d12986d7d02fa2f958ebbdb3d8a2ecea498a8afd9f43c2e3d46a88109364bc0ba172f91c7d5853ed4bd173ef34bc451d31c7b3 SHA512 c392bfc173c2a2e20821b862c3f23621bcd0c20884f58623c345921aaa4f0557b3f75e75e5577a0df150adf119ec008af5ad1fcbfe11248d73918c0a211e8df9
+DIST mysqlclient-2.2.1.tar.gz 89966 BLAKE2B b5098ea4afe8ba720c40eda2f0f5da043622bed51a123e225530d505edfef2f02efba477238d73f343a6cc4969bf021156e15528f05a12d905ea6231e47d65bd SHA512 3ff3823cef4662268387e5c13d006595219c5a3371201eb251d84db5eec028b32fd7b672dbdac9f4dffa906fddcfc9a5ee130e3b03e4dc0cfb060411ad75eea8
diff --git a/dev-python/mysqlclient/mysqlclient-2.2.1.ebuild b/dev-python/mysqlclient/mysqlclient-2.2.1.ebuild
new file mode 100644
index 000000000000..a2d3e272c1f8
--- /dev/null
+++ b/dev-python/mysqlclient/mysqlclient-2.2.1.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2023 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..12} )
+
+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 ~ia64 ~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
+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
+}