# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 PYTHON_COMPAT=( python2_7 ) inherit distutils-r1 MY_PN="PyMySQL" MY_P="${MY_PN}-${PV}" DESCRIPTION="Pure-Python MySQL Driver" HOMEPAGE="https://github.com/PyMySQL/PyMySQL" SRC_URI="https://github.com/${MY_PN}/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" S=${WORKDIR}/${MY_P} LICENSE="MIT" SLOT="python2" KEYWORDS="amd64 ~arm64 x86" IUSE="test" RESTRICT="!test? ( test )" # TODO: support other mysql variants BDEPEND=" test? ( dev-db/mariadb[server] )" RDEPEND=" ! pymysql/tests/databases.json <<-EOF || die [{ "host": "localhost", "user": "root", "passwd": "", "db": "test1", "use_unicode": true, "local_infile": true, "unix_socket": "${T}/mysqld.sock" }, { "host": "localhost", "user": "root", "passwd": "", "db": "test2", "unix_socket": "${T}/mysqld.sock" }] EOF distutils-r1_src_test kill "${pid}" wait "${pid}" } python_test() { ${PYTHON} runtests.py || die }