mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
dev-python/pymysql: Bump to 1.0.3
Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
@@ -1 +1,2 @@
|
||||
DIST PyMySQL-1.0.3.gh.tar.gz 85371 BLAKE2B 4caaf486413b0fd78acc04c6856b044048c5af28e2b8f85125dda83738daeb31f621726babd8ce724b01fc3f297769f09c2c77b60540cb5c66d152c61fd725e8 SHA512 46d56399b02e61b4b31af82f96cfbb6c24e0c18f780c872bde53a818ad74d30dfe8ded1fdac97971433b0e237e1007631a9c0e38ef2cb17b6601c77f624faf8b
|
||||
DIST pymysql-1.0.2.gh.tar.gz 84985 BLAKE2B f2b740827cfa9a4a9cdfe9d711e78d61c2cac2afbc2f15ecc3e317a7fff7771d3d79b8d963e085f011123029341edd469514d84be8cdc5e9aa143cd0fa2caae5 SHA512 c98633c465705154c0607f4508e4d19986fafb647eac01832f8e3fb0175565958289518f9632897ffba924406fce00881a351dbae05c7d68a55eec2b86a55638
|
||||
|
||||
@@ -12,6 +12,6 @@
|
||||
<stabilize-allarches/>
|
||||
<upstream>
|
||||
<remote-id type="github">PyMySQL/PyMySQL</remote-id>
|
||||
<remote-id type="pypi">PyMySQL</remote-id>
|
||||
<remote-id type="pypi">pymysql</remote-id>
|
||||
</upstream>
|
||||
</pkgmetadata>
|
||||
|
||||
118
dev-python/pymysql/pymysql-1.0.3.ebuild
Normal file
118
dev-python/pymysql/pymysql-1.0.3.ebuild
Normal file
@@ -0,0 +1,118 @@
|
||||
# Copyright 1999-2023 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
PYTHON_COMPAT=( python3_{9..11} pypy3 )
|
||||
DISTUTILS_USE_PEP517=setuptools
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
MY_P="PyMySQL-${PV}"
|
||||
DESCRIPTION="Pure-Python MySQL Driver"
|
||||
HOMEPAGE="
|
||||
https://github.com/PyMySQL/PyMySQL/
|
||||
https://pypi.org/project/pymysql/
|
||||
"
|
||||
SRC_URI="
|
||||
https://github.com/PyMySQL/PyMySQL/archive/v${PV}.tar.gz
|
||||
-> ${MY_P}.gh.tar.gz
|
||||
"
|
||||
S=${WORKDIR}/${MY_P}
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
|
||||
|
||||
# TODO: support other mysql variants
|
||||
BDEPEND="
|
||||
test? (
|
||||
dev-db/mariadb[server]
|
||||
)
|
||||
"
|
||||
|
||||
distutils_enable_tests pytest
|
||||
|
||||
src_prepare() {
|
||||
# Auth tests don't support socket auth
|
||||
find tests/ -name '*_auth.py' -delete || die
|
||||
|
||||
distutils-r1_src_prepare
|
||||
}
|
||||
|
||||
src_test() {
|
||||
local -x USER=$(whoami)
|
||||
local -x PATH="${BROOT}/usr/share/mariadb/scripts:${PATH}"
|
||||
|
||||
einfo "Creating mysql test instance ..."
|
||||
mkdir -p "${T}"/mysql || die
|
||||
mysql_install_db \
|
||||
--no-defaults \
|
||||
--auth-root-authentication-method=normal \
|
||||
--basedir="${EPREFIX}/usr" \
|
||||
--datadir="${T}"/mysql 1>"${T}"/mysqld_install.log || die
|
||||
|
||||
einfo "Starting mysql test instance ..."
|
||||
# TODO: random port
|
||||
mysqld \
|
||||
--no-defaults \
|
||||
--character-set-server=utf8 \
|
||||
--bind-address=127.0.0.1 \
|
||||
--port=43306 \
|
||||
--pid-file="${T}"/mysqld.pid \
|
||||
--socket="${T}"/mysqld.sock \
|
||||
--datadir="${T}"/mysql 1>"${T}"/mysqld.log 2>&1 &
|
||||
|
||||
# wait for it to start
|
||||
local i
|
||||
for (( i = 0; i < 10; i++ )); do
|
||||
[[ -S ${T}/mysqld.sock ]] && break
|
||||
sleep 1
|
||||
done
|
||||
[[ ! -S ${T}/mysqld.sock ]] && die "mysqld failed to start"
|
||||
|
||||
einfo "Configuring test mysql instance ..."
|
||||
|
||||
# note: ed25519 was removed since it fails -- upstream README indicates
|
||||
# it can fail if we used a different server version
|
||||
mysql -uroot --socket="${T}"/mysqld.sock -s -e '
|
||||
CREATE DATABASe test1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
|
||||
CREATE DATABASE test2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
|
||||
' || die "Failed to create test databases"
|
||||
|
||||
cat > pymysql/tests/databases.json <<-EOF || die
|
||||
[{
|
||||
"host": "localhost",
|
||||
"user": "root",
|
||||
"password": "",
|
||||
"database": "test1",
|
||||
"use_unicode": true,
|
||||
"local_infile": true,
|
||||
"unix_socket": "${T}/mysqld.sock"
|
||||
}, {
|
||||
"host": "localhost",
|
||||
"user": "root",
|
||||
"password": "",
|
||||
"database": "test2",
|
||||
"unix_socket": "${T}/mysqld.sock"
|
||||
}]
|
||||
EOF
|
||||
|
||||
nonfatal distutils-r1_src_test
|
||||
local ret=${?}
|
||||
|
||||
einfo "Stopping mysql test instance ..."
|
||||
pkill -F "${T}"/mysqld.pid || die
|
||||
|
||||
[[ ${ret} -ne 0 ]] && die
|
||||
}
|
||||
|
||||
python_test() {
|
||||
local EPYTEST_DESELECT=(
|
||||
# requires some dialog plugin
|
||||
pymysql/tests/test_connection.py::TestAuthentication::testDialogAuthThreeAttemptsQuestionsInstallPlugin
|
||||
pymysql/tests/test_connection.py::TestAuthentication::testDialogAuthTwoQuestionsInstallPlugin
|
||||
)
|
||||
|
||||
epytest
|
||||
}
|
||||
Reference in New Issue
Block a user