public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pymysql/
Date: Thu,  7 Jan 2021 09:16:15 +0000 (UTC)	[thread overview]
Message-ID: <1610010964.38c97b264cec88015d30f14f944ceb47d646164e.mgorny@gentoo> (raw)

commit:     38c97b264cec88015d30f14f944ceb47d646164e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jan  7 08:45:58 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jan  7 09:16:04 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=38c97b26

dev-python/pymysql: Bump to 1.0.0

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/pymysql/Manifest             |   1 +
 dev-python/pymysql/pymysql-1.0.0.ebuild | 144 ++++++++++++++++++++++++++++++++
 2 files changed, 145 insertions(+)

diff --git a/dev-python/pymysql/Manifest b/dev-python/pymysql/Manifest
index 8ff259cd603..f72aad94927 100644
--- a/dev-python/pymysql/Manifest
+++ b/dev-python/pymysql/Manifest
@@ -1 +1,2 @@
 DIST pymysql-0.10.1.tar.gz 86441 BLAKE2B 8e33fbba0544dad68c3eeb5bd538c4bce121222b4660ad06c3c0224b5db6a6c9f45d6697a98d5f0ba20429afa204d46c9ce57a4d9696dbc2a35649c6253a645b SHA512 edc702c54a33350f75648765c60d4cf455449e88818948b018585d557bea280e626d23b1279a410765f2de8e35b3c22ea5c8e0ef3dc72588b674c93a2124a224
+DIST pymysql-1.0.0.tar.gz 85033 BLAKE2B 792b472c2a230e823cca9deed5adc03a004e34b09594d998c1df332769b93dde3f0b84a11f1b1ac83b6be34fe661194d3c780d6a5bb0facf193d2f46a807a7b8 SHA512 52c4ad45f31725bcbb313d4d1bea52bb52c82ad9573a58dd8cca14e844ff9d7e3831debb3bd08d00a07cc32625b15692138947ccd9ad3bed7f869a7bd69357b3

diff --git a/dev-python/pymysql/pymysql-1.0.0.ebuild b/dev-python/pymysql/pymysql-1.0.0.ebuild
new file mode 100644
index 00000000000..6bd9ec18f00
--- /dev/null
+++ b/dev-python/pymysql/pymysql-1.0.0.ebuild
@@ -0,0 +1,144 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6..9} pypy3 )
+
+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="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+
+# TODO: support other mysql variants
+BDEPEND="
+	test? (
+		dev-db/mariadb[server]
+		dev-python/mock[${PYTHON_USEDEP}]
+	)"
+
+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() {
+	if [[ -z "${USER}" ]] ; then
+		# Tests require system user
+		local -x USER="$(whoami)"
+		einfo "USER set to '${USER}'"
+	fi
+
+	local PIDFILE="${T}/mysqld.pid"
+	if pkill -0 -F "${PIDFILE}" &>/dev/null ; then
+		einfo "Killing already running mysqld process ..."
+		pkill -F "${PIDFILE}"
+	fi
+
+	if [[ -d "${T}/mysql" ]] ; then
+		einfo "Removing already existing mysqld data dir ..."
+		rm -rf "${T}/mysql" || die
+	fi
+
+	einfo "Creating mysql test instance ..."
+	mkdir -p "${T}"/mysql || die
+	"${BROOT}"/usr/share/mariadb/scripts/mysql_install_db \
+		--no-defaults \
+		--auth-root-authentication-method=normal \
+		--basedir="${BROOT}/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 ..."
+
+	# create test user for auth tests
+	mysql -uroot --socket="${T}"/mysqld.sock -s -e '
+		INSTALL SONAME "auth_ed25519";
+		CREATE FUNCTION ed25519_password RETURNS STRING SONAME "auth_ed25519.so";
+	' || die "Failed to set up auth_ed25519"
+
+	mysql -uroot --socket="${T}"/mysqld.sock -s -e "
+		SELECT CONCAT('CREATE USER nopass_ed25519 IDENTIFIED VIA ed25519 USING \"',ed25519_password(\"\"),'\";');
+		SELECT CONCAT('CREATE USER user_ed25519 IDENTIFIED VIA ed25519 USING \"',ed25519_password(\"pass_ed25519\"),'\";');
+	" || die "Failed to create ed25519 test users"
+
+	# create test databases
+	mysql -uroot --socket="${T}"/mysqld.sock -s -e '
+		create database test1 DEFAULT CHARACTER SET utf8mb4;
+		create database test2 DEFAULT CHARACTER SET utf8mb4;
+
+		create user test2 identified by "some password";
+		grant all on test2.* to test2;
+
+		create user test2@localhost identified by "some password";
+		grant all on test2.* to test2@localhost;
+	' || 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
+
+	distutils-r1_src_test
+
+	if pkill -0 -F "${PIDFILE}" &>/dev/null ; then
+		einfo "Stopping mysql test instance ..."
+		pkill -F "${PIDFILE}"
+	fi
+}
+
+python_test() {
+	local excludes=(
+		# requires some dialog plugin
+		pymysql/tests/test_connection.py::TestAuthentication::testDialogAuthThreeAttemptsQuestionsInstallPlugin
+		pymysql/tests/test_connection.py::TestAuthentication::testDialogAuthTwoQuestionsInstallPlugin
+	)
+
+	PYTHONPATH=. pytest -vv ${excludes[@]/#/--deselect } ||
+		die "Tests failed with ${EPYTHON}"
+}


             reply	other threads:[~2021-01-07  9:16 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-07  9:16 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-02-27 21:07 [gentoo-commits] repo/gentoo:master commit in: dev-python/pymysql/ Michał Górny
2024-05-22  9:10 Michał Górny
2024-05-22  9:05 Michał Górny
2024-05-22  4:49 Michał Górny
2024-05-22  4:49 Michał Górny
2024-05-18  8:09 Michał Górny
2024-01-04 11:29 WANG Xuerui
2023-07-28  9:26 Michał Górny
2023-07-28  9:26 Michał Górny
2023-07-28  7:56 Sam James
2023-06-27  3:54 Michał Górny
2023-04-28 14:49 Arthur Zamarin
2023-04-28 14:47 Arthur Zamarin
2023-03-28 13:23 Michał Górny
2022-11-06  7:59 Michał Górny
2022-11-06  7:24 Sam James
2022-10-14 15:09 Andrew Ammerlaan
2022-02-14  8:35 Matt Turner
2021-11-14 23:51 Sam James
2021-10-24 21:14 Sam James
2021-10-02 23:17 Sam James
2021-09-06 23:42 Sam James
2021-09-06 23:37 Sam James
2021-09-06  0:13 Sam James
2021-08-10  4:59 Sam James
2021-07-28 16:14 Sergei Trofimovich
2021-06-05 17:59 Michał Górny
2021-03-20 19:21 Thomas Deutschmann
2021-02-25 13:54 Agostino Sarubbo
2021-01-09 17:40 Michał Górny
2021-01-08  9:29 Michał Górny
2020-10-09  8:53 Michał Górny
2020-10-09  8:40 Agostino Sarubbo
2020-10-02 14:40 Thomas Deutschmann
2020-09-23  7:29 Michał Górny
2020-09-17 15:16 Brian Evans
2020-08-18  5:52 Sam James
2020-06-11 20:33 Michał Górny
2020-06-11 20:33 Michał Górny
2020-06-11 20:33 Michał Górny
2020-04-18 17:55 Craig Andrews
2020-02-05 19:53 Michał Górny
2020-01-07 20:24 Brian Evans
2019-01-16 13:33 Thomas Deutschmann
2018-09-11 19:13 Brian Evans
2018-06-09 17:09 Thomas Deutschmann
2018-02-22 21:23 Thomas Deutschmann
2018-01-05 23:19 Michał Górny
2017-09-29 23:32 Matt Thode
2017-08-30 21:07 Matt Thode
2017-03-10 21:58 Zac Medico
2017-01-26 20:27 Brian Evans
2016-09-04  6:46 Patrice Clement
2015-10-19 16:29 Justin Lecher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1610010964.38c97b264cec88015d30f14f944ceb47d646164e.mgorny@gentoo \
    --to=mgorny@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox