public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/mysqlclient/, profiles/arch/riscv/
@ 2021-08-20 23:49 Louis Sautier
  0 siblings, 0 replies; only message in thread
From: Louis Sautier @ 2021-08-20 23:49 UTC (permalink / raw
  To: gentoo-commits

commit:     2337aa56b7a856295a6d8bb27f0e3a7a601794fe
Author:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 20 23:18:47 2021 +0000
Commit:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
CommitDate: Fri Aug 20 23:48:38 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2337aa56

dev-python/mysqlclient: add 2.0.3, enable py3.10 and tests

Also:
* Update licence to GPL-2+.
* Remove RST files from DOCS, they are included in HTML_DOCS.
* Bump to EAPI 8.
* Mask the test USE flag for riscv where dev-db/mariadb is not
  available.
* Remove reference to treecleaned dev-python/mysql-python.

Closes: https://bugs.gentoo.org/798207
Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org>

 dev-python/mysqlclient/Manifest                 |  1 +
 dev-python/mysqlclient/mysqlclient-2.0.3.ebuild | 87 +++++++++++++++++++++++++
 profiles/arch/riscv/package.use.mask            |  1 +
 3 files changed, 89 insertions(+)

diff --git a/dev-python/mysqlclient/Manifest b/dev-python/mysqlclient/Manifest
index 40d6288539d..a37fee4192c 100644
--- a/dev-python/mysqlclient/Manifest
+++ b/dev-python/mysqlclient/Manifest
@@ -1 +1,2 @@
 DIST mysqlclient-1.4.6.tar.gz 85517 BLAKE2B f5e604094b06b919b92ecadc8b3f0249dd038149d1182ba882fe6b0ecd34f0bcceeed21b310318ca3291d9483fd3d1ac385c29415e07a8fbabb6cd65ccee8a2d SHA512 11ecb8a0a6f78edb193cd07472579aec1626994a80a584ff74de18774e7db8896de595f3e4d280b78e8636f53323ebcce8aa294ec7b2a54a839742d9699650ab
+DIST mysqlclient-2.0.3.tar.gz 88886 BLAKE2B 2673f2ab46ddff241260b036b14bad84947a37d002cbacd7aa53127fa3dd4fad7a37c9e2f8704d43cab6a2e0289f2542cb36ccb3f1bd66c64d2440f79d26948e SHA512 49c234bc982b373a74d65361a697dfa4f87f06d193d86d7cc40a732f48c9b2494cea21ee3f95d4d6d2a55b3f7476a92eda0c2e294766cb0ff592e1c54353b9cb

diff --git a/dev-python/mysqlclient/mysqlclient-2.0.3.ebuild b/dev-python/mysqlclient/mysqlclient-2.0.3.ebuild
new file mode 100644
index 00000000000..b9255ad56f2
--- /dev/null
+++ b/dev-python/mysqlclient/mysqlclient-2.0.3.ebuild
@@ -0,0 +1,87 @@
+# 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="Fork of MySQL-python"
+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}"
+}

diff --git a/profiles/arch/riscv/package.use.mask b/profiles/arch/riscv/package.use.mask
index 54fe2fc8dea..3ef7208c83c 100644
--- a/profiles/arch/riscv/package.use.mask
+++ b/profiles/arch/riscv/package.use.mask
@@ -37,6 +37,7 @@ sys-auth/sssd test
 #  dev-db/mariadb fails tests here, see Bug #807995
 #  dev-db/mysql and dev-db/percona-server do not support this arch
 #  dev-db/mysql-cluster not tested yet, seriously outdated in the tree
+dev-python/mysqlclient test
 dev-python/pymysql test
 sci-libs/gdal mysql
 sys-cluster/slurm slurmdbd


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-20 23:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-20 23:49 [gentoo-commits] repo/gentoo:master commit in: dev-python/mysqlclient/, profiles/arch/riscv/ Louis Sautier

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