diff options
Diffstat (limited to 'dev-python/mysqlclient')
-rw-r--r-- | dev-python/mysqlclient/Manifest | 2 | ||||
-rw-r--r-- | dev-python/mysqlclient/mysqlclient-2.1.0.ebuild | 86 |
2 files changed, 88 insertions, 0 deletions
diff --git a/dev-python/mysqlclient/Manifest b/dev-python/mysqlclient/Manifest index bd10bd892a28..288b85eb3cb6 100644 --- a/dev-python/mysqlclient/Manifest +++ b/dev-python/mysqlclient/Manifest @@ -1,5 +1,7 @@ DIST mysqlclient-1.4.6.tar.gz 85517 BLAKE2B f5e604094b06b919b92ecadc8b3f0249dd038149d1182ba882fe6b0ecd34f0bcceeed21b310318ca3291d9483fd3d1ac385c29415e07a8fbabb6cd65ccee8a2d SHA512 11ecb8a0a6f78edb193cd07472579aec1626994a80a584ff74de18774e7db8896de595f3e4d280b78e8636f53323ebcce8aa294ec7b2a54a839742d9699650ab DIST mysqlclient-2.0.3.tar.gz 88886 BLAKE2B 2673f2ab46ddff241260b036b14bad84947a37d002cbacd7aa53127fa3dd4fad7a37c9e2f8704d43cab6a2e0289f2542cb36ccb3f1bd66c64d2440f79d26948e SHA512 49c234bc982b373a74d65361a697dfa4f87f06d193d86d7cc40a732f48c9b2494cea21ee3f95d4d6d2a55b3f7476a92eda0c2e294766cb0ff592e1c54353b9cb +DIST mysqlclient-2.1.0.tar.gz 87635 BLAKE2B b92e138f6128873912e951087bc4f12b3c00a400521c7ee64da177c6f5a2dfb3a649d92f7a12f45c8716fd8b6b9682a0eff6d9bc111cffac38a27676f67d396a SHA512 a0b2645af225fd6f1f551cfd34c09309a859410e66287c32637901e15beb88632f9a3e87cf2b08a94867a9b2d4a048c56d63d55f523eafc82f1b1b93ce1c843c EBUILD mysqlclient-1.4.6-r1.ebuild 882 BLAKE2B cddc4e111d81da2ecb0578ead854950dfa7154a5305ad11d45c0cddeb7460756f276ab2a71b514dc5102397b3def80c6692274e57c6349898218aa9ab70a4a65 SHA512 4474ff3d671bee527ccd47eb78d646b07864db62dbf813d5ecd7378f4110f8e2cac16cfc11a05e8a603122984c24b035fa924c6b4ef5f1c8f3670056d713965f EBUILD mysqlclient-2.0.3.ebuild 2094 BLAKE2B 9b32939d9adef05778839247cd3e488047bb9adefc21c930d7bb41e10417a6f083ad13093cca1f1e914ca7f30a1f300a38824fd83030581acf9c06f5e70a61ff SHA512 af53eee1eaf193d51aa4a6e9b3198fb13f6fbe071857ebc31c2a7348d23ad131571a78584290eb7a9b51c7804055bb2f360646c5b6856a7fdb7d79d6c02f8469 +EBUILD mysqlclient-2.1.0.ebuild 2066 BLAKE2B 7f66b826780638f984e0df62a922f2ee4975abbd6895a8cef1464a7a171e588aae5db01e74e327aa10df4f4debdf5df6fe89c8864370d78847a6a74977b8bb01 SHA512 992f2497e75280af610a9ccae79bb47434e08abd55a6891aa3c7417fb52d28315628d24d344aeda20e3906ceb53e2e17ce09c1bc695bba50d7da210f704cb94c MISC metadata.xml 514 BLAKE2B 6c9f1d00d136f60a412e1fc87923ac25e1985843b04d4c5b6ce7cc65521ec23f5070dc4001cb7426cabaeec949e40498e9adeef8bd19cd4bff0761a918d2896c SHA512 01797cf940a6baa96885c2cbc9073e2386f8bbe9c1cec14c2b6b6e5cb12a4da6308a2081d894de3342c69165a4836f6d9e593f9a324712b8dfd30a3874c81223 diff --git a/dev-python/mysqlclient/mysqlclient-2.1.0.ebuild b/dev-python/mysqlclient/mysqlclient-2.1.0.ebuild new file mode 100644 index 000000000000..a763baf3ee69 --- /dev/null +++ b/dev-python/mysqlclient/mysqlclient-2.1.0.ebuild @@ -0,0 +1,86 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..10} ) +inherit distutils-r1 + +DESCRIPTION="Python interface to MySQL" +HOMEPAGE="https://pypi.org/project/mysqlclient/ https://github.com/PyMySQL/mysqlclient-python" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux" + +RDEPEND=" + dev-db/mysql-connector-c:0= +" +DEPEND="${RDEPEND}" +BDEPEND=" + test? ( + dev-db/mariadb[server] + ) +" + +distutils_enable_sphinx doc +distutils_enable_tests pytest + +src_test() { + 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() { + # The C extension ("_mysql") can't be imported from "${S}/MySQLdb" + # so we need to cd somewhere else to make sure "MySQLdb" is imported + # from ${BUILD_DIR}/lib (thanks to PYTHONPATH). + cd "${T}" || die + TESTDB="${T}/mysql.cnf" epytest "${S}" +} |