commit:     d968c6d9916bca88900c240bb26874ba93b6e3aa
Author:     Andrey Grozin <grozin <AT> gentoo <DOT> org>
AuthorDate: Sat Nov  5 16:23:46 2022 +0000
Commit:     Andrey Grozin <grozin <AT> gentoo <DOT> org>
CommitDate: Sat Nov  5 16:23:46 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d968c6d9

dev-python/rpyc: Make gevent optional

Signed-off-by: Andrey Grozin <grozin <AT> gentoo.org>

 dev-python/rpyc/metadata.xml         |  2 +
 dev-python/rpyc/rpyc-5.2.3-r3.ebuild | 71 ++++++++++++++++++++++++++++++++++++
 2 files changed, 73 insertions(+)

diff --git a/dev-python/rpyc/metadata.xml b/dev-python/rpyc/metadata.xml
index 9bb47af5f2a2..0cc85787c0c5 100644
--- a/dev-python/rpyc/metadata.xml
+++ b/dev-python/rpyc/metadata.xml
@@ -15,6 +15,8 @@
                <flag name="numpy">Run tests depending on
                        <pkg>dev-python/numpy</pkg>, 
<pkg>dev-python/pandas</pkg>
                </flag>
+               <flag name="gevent">Use <pkg>dev-python/gevent</pkg> for 
GeventServer
+               </flag>
                <flag name="gdb">Run tests depending on <pkg>sys-devel/gdb</pkg>
                </flag>
        </use>

diff --git a/dev-python/rpyc/rpyc-5.2.3-r3.ebuild 
b/dev-python/rpyc/rpyc-5.2.3-r3.ebuild
new file mode 100644
index 000000000000..457166812a05
--- /dev/null
+++ b/dev-python/rpyc/rpyc-5.2.3-r3.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+DISTUTILS_USE_PEP517=hatchling
+PYTHON_COMPAT=( python3_{8..10} )
+# Teleporting currently does not work with python-3.11
+# see https://github.com/tomerfiliba-org/rpyc/issues/513
+
+inherit distutils-r1
+
+DESCRIPTION="Remote Python Call (RPyC), a transparent and symmetric RPC 
library"
+HOMEPAGE="https://rpyc.readthedocs.io/en/latest/
+       https://pypi.org/project/rpyc/
+       https://github.com/tomerfiliba-org/rpyc";
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+# USE flags gdb, numpy are used *only* to run tests depending on these packages
+IUSE="test numpy gdb gevent"
+RESTRICT="!test? ( test )"
+
+CDEPEND="numpy? ( dev-python/numpy[${PYTHON_USEDEP}] 
dev-python/pandas[${PYTHON_USEDEP}] )
+       gevent? ( dev-python/gevent[${PYTHON_USEDEP}] )
+       gdb? ( sys-devel/gdb )"
+
+DEPEND="${CDEPEND}
+       dev-python/setuptools[${PYTHON_USEDEP}]"
+
+RDEPEND="${CDEPEND}
+       dev-python/plumbum[${PYTHON_USEDEP}]"
+
+src_prepare() {
+       default
+
+       # Windows specific test
+       rm tests/test_win32pipes.py || die "rm tests/test_win32pipes.py failed"
+
+       # These tests require running sshd
+       rm tests/test_ssh.py tests/test_deploy.py || die "rm test_ssh.py 
test_deploy.py failed"
+
+       # This test requires internet access
+       rm tests/test_registry.py || die "rm test_registry.py failed"
+
+       # This test fails with NO_CIPHERS_AVAILABLE
+       rm tests/test_ssl.py || die "rm test_ssl.py failed"
+
+       if ! use numpy
+       then rm tests/test_service_pickle.py || die "rm test_service_pickle.py 
failed"
+       fi
+
+       if ! use gevent
+       then rm tests/test_gevent_server.py || die "rm test_gevent_server.py 
failed"
+       fi
+
+       if ! use gdb
+       then rm tests/test_gdb.py || die "rm test_gdb.py failed"
+       fi
+}
+
+python_test() {
+       # for some reason, when tests are run via pytest or nose, some of them 
hung
+       pushd tests > /dev/null || die "pushd tests failed"
+       for x in test_*.py
+       do 
PYTHONPATH="${WORKDIR}"/${P}-${EPYTHON/./_}/install/usr/lib/${EPYTHON}/site-packages
 ${EPYTHON} ${x} || die "${x} failed"
+       done
+       popd > /dev/null
+}

Reply via email to