summaryrefslogtreecommitdiff
path: root/dev-python/socketpool
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/socketpool')
-rw-r--r--dev-python/socketpool/Manifest1
-rw-r--r--dev-python/socketpool/files/socketpool-0.5.2-locale.patch21
-rw-r--r--dev-python/socketpool/metadata.xml23
-rw-r--r--dev-python/socketpool/socketpool-0.5.3-r2.ebuild61
-rw-r--r--dev-python/socketpool/socketpool-0.5.3-r3.ebuild69
5 files changed, 175 insertions, 0 deletions
diff --git a/dev-python/socketpool/Manifest b/dev-python/socketpool/Manifest
new file mode 100644
index 000000000000..98de8aff3fd5
--- /dev/null
+++ b/dev-python/socketpool/Manifest
@@ -0,0 +1 @@
+DIST socketpool-0.5.3.tar.gz 9793 BLAKE2B 89b7b71d9f05f7f5e560eb3cb5e7cd4d2254ff971066d236b98903d790dd96f6c580333e9fafeab7314c50f499c9617df706a20efa1c52de069c583b6dabd928 SHA512 6d16a18927672157703fb5a29f4332241f9ddf743dfee8f2606d600dbb75d547f2e0dcc0398febe55df3319829a80b3f537b5877679e4f674569ef55de78c1b7
diff --git a/dev-python/socketpool/files/socketpool-0.5.2-locale.patch b/dev-python/socketpool/files/socketpool-0.5.2-locale.patch
new file mode 100644
index 000000000000..aa0af681a768
--- /dev/null
+++ b/dev-python/socketpool/files/socketpool-0.5.2-locale.patch
@@ -0,0 +1,21 @@
+diff -ur socketpool-0.5.2.orig/setup.py socketpool-0.5.2/setup.py
+--- socketpool-0.5.2.orig/setup.py 2012-08-05 12:33:47.000000000 +0800
++++ socketpool-0.5.2/setup.py 2013-02-05 00:22:13.685705089 +0800
+@@ -5,7 +5,7 @@
+ # See the NOTICE for more information.
+
+
+-import os
++import os, io
+ from setuptools import setup, find_packages
+
+ CLASSIFIERS = [
+@@ -22,7 +22,7 @@
+
+
+ # read long description
+-with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f:
++with io.open(os.path.join(os.path.dirname(__file__), 'README.rst'), encoding='utf8') as f:
+ long_description = f.read()
+
+ DATA_FILES = [
diff --git a/dev-python/socketpool/metadata.xml b/dev-python/socketpool/metadata.xml
new file mode 100644
index 000000000000..6a7870287d93
--- /dev/null
+++ b/dev-python/socketpool/metadata.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="pypi">socketpool</remote-id>
+ <remote-id type="github">benoitc/socketpool</remote-id>
+ </upstream>
+ <use>
+ <flag name="eventlet">
+ Install <pkg>dev-python/eventlet</pkg> as needed for the eventlet
+ backend.
+ </flag>
+ <flag name="gevent">
+ Install <pkg>dev-python/gevent</pkg> as needed for the gevent
+ backend.
+ </flag>
+ </use>
+ <origin>gentoo-staging</origin>
+</pkgmetadata>
diff --git a/dev-python/socketpool/socketpool-0.5.3-r2.ebuild b/dev-python/socketpool/socketpool-0.5.3-r2.ebuild
new file mode 100644
index 000000000000..e0fffe7af7ae
--- /dev/null
+++ b/dev-python/socketpool/socketpool-0.5.3-r2.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python2_7 python3_{6,7,8,9} pypy3 )
+
+inherit distutils-r1
+
+DESCRIPTION="A simple Python socket pool"
+HOMEPAGE="https://github.com/benoitc/socketpool/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+KEYWORDS="~alpha amd64 arm arm64 ~ia64 ppc ppc64 s390 ~sparc x86"
+IUSE="examples gevent"
+LICENSE="|| ( MIT public-domain )"
+SLOT="0"
+
+RDEPEND="
+ gevent? (
+ $(python_gen_cond_dep '
+ dev-python/gevent[${PYTHON_USEDEP}]
+ ' 'python*')
+ )"
+
+BDEPEND="
+ test? (
+ !ia64? (
+ $(python_gen_cond_dep '
+ dev-python/gevent[${PYTHON_USEDEP}]
+ ' 'python*')
+ )
+ )"
+
+PATCHES=( "${FILESDIR}"/${PN}-0.5.2-locale.patch )
+
+distutils_enable_tests pytest
+
+src_prepare() {
+ # py3.9
+ sed -i -e 's:isAlive:is_alive:' socketpool/backend_thread.py || die
+
+ distutils-r1_src_prepare
+}
+
+python_test() {
+ cp -r examples tests "${BUILD_DIR}" || die
+
+ pushd "${BUILD_DIR}" >/dev/null || die
+ pytest -vv tests || die "Tests fail with ${EPYTHON}"
+ popd >/dev/null || die
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ use examples && dodoc -r examples
+
+ # package installs unneeded LICENSE files here
+ rm -r "${ED}"/usr/socketpool || die
+}
diff --git a/dev-python/socketpool/socketpool-0.5.3-r3.ebuild b/dev-python/socketpool/socketpool-0.5.3-r3.ebuild
new file mode 100644
index 000000000000..ec04b5041af9
--- /dev/null
+++ b/dev-python/socketpool/socketpool-0.5.3-r3.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python2_7 python3_{6,7,8,9} pypy3 )
+
+inherit distutils-r1
+
+DESCRIPTION="A simple Python socket pool"
+HOMEPAGE="https://github.com/benoitc/socketpool/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="eventlet examples gevent"
+LICENSE="|| ( MIT public-domain )"
+SLOT="0"
+
+RDEPEND="
+ eventlet? (
+ $(python_gen_cond_dep '
+ dev-python/eventlet[${PYTHON_USEDEP}]
+ ' 'python3*')
+ )
+ gevent? (
+ $(python_gen_cond_dep '
+ dev-python/gevent[${PYTHON_USEDEP}]
+ ' 'python*')
+ )"
+
+BDEPEND="
+ test? (
+ !alpha? ( !hppa? ( !ia64? (
+ $(python_gen_cond_dep '
+ dev-python/eventlet[${PYTHON_USEDEP}]
+ ' 'python3*')
+ $(python_gen_cond_dep '
+ dev-python/gevent[${PYTHON_USEDEP}]
+ ' 'python*')
+ ) ) )
+ )"
+
+PATCHES=( "${FILESDIR}"/${PN}-0.5.2-locale.patch )
+
+distutils_enable_tests pytest
+
+src_prepare() {
+ # py3.9
+ sed -i -e 's:isAlive:is_alive:' socketpool/backend_thread.py || die
+
+ distutils-r1_src_prepare
+}
+
+python_test() {
+ cp -r examples tests "${BUILD_DIR}" || die
+
+ pushd "${BUILD_DIR}" >/dev/null || die
+ pytest -vv tests || die "Tests fail with ${EPYTHON}"
+ popd >/dev/null || die
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ use examples && dodoc -r examples
+
+ # package installs unneeded LICENSE files here
+ rm -r "${ED}"/usr/socketpool || die
+}