summaryrefslogtreecommitdiff
path: root/dev-python/python-memcached/python-memcached-1.59-r2.ebuild
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-03-06 17:54:58 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-03-06 17:54:58 +0000
commit47223eb70974998c84966981d9e4fc2be27b3f8a (patch)
tree961d3fea7a2e379eac81620131a0b6df82e7e9c3 /dev-python/python-memcached/python-memcached-1.59-r2.ebuild
parent62277f96ac0a859cfd02e8d1775081a4ba521682 (diff)
gentoo auto-resync : 06:03:2023 - 17:54:58
Diffstat (limited to 'dev-python/python-memcached/python-memcached-1.59-r2.ebuild')
-rw-r--r--dev-python/python-memcached/python-memcached-1.59-r2.ebuild54
1 files changed, 54 insertions, 0 deletions
diff --git a/dev-python/python-memcached/python-memcached-1.59-r2.ebuild b/dev-python/python-memcached/python-memcached-1.59-r2.ebuild
new file mode 100644
index 000000000000..ba8ceed185ef
--- /dev/null
+++ b/dev-python/python-memcached/python-memcached-1.59-r2.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( pypy3 python3_{9..11} )
+
+inherit distutils-r1
+
+DESCRIPTION="Pure python memcached client"
+HOMEPAGE="
+ https://github.com/linsomniac/python-memcached/
+ https://pypi.org/project/python-memcached/
+"
+SRC_URI="
+ https://github.com/linsomniac/python-memcached/archive/${PV}.tar.gz
+ -> ${P}.gh.tar.gz
+"
+
+LICENSE="PSF-2.4"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+
+RDEPEND="
+ dev-python/six[${PYTHON_USEDEP}]
+"
+BDEPEND="
+ test? (
+ dev-python/mock[${PYTHON_USEDEP}]
+ net-misc/memcached
+ )
+"
+
+distutils_enable_tests unittest
+
+python_test() {
+ local pidfile="${TMPDIR}/memcached.pid"
+
+ memcached -d -P "${pidfile}" || die "failed to start memcached"
+
+ eunittest || die "Tests fail with ${EPYTHON}"
+
+ kill "$(<"${pidfile}")" || die "failed to kill memcached"
+ local elapsed=0
+ while [[ -f ${pidfile} ]]; do
+ if [[ $(( elapsed++ )) -ge 30 ]]; then
+ kill -KILL "$(<"${pidfile}")" ||
+ die "failed to kill -KILL memcached"
+ die "memcached failed to stop after 30 seconds"
+ fi
+ sleep 1
+ done
+}