commit:     827734e19d4d85d2d4cc3f52352996e87fa89d17
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 17 14:04:13 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Aug 18 08:03:55 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=827734e1

dev-python/setproctitle: Port to pypy3

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

 .../setproctitle/setproctitle-1.1.10-r1.ebuild     | 31 +++++++++++-----------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/dev-python/setproctitle/setproctitle-1.1.10-r1.ebuild 
b/dev-python/setproctitle/setproctitle-1.1.10-r1.ebuild
index a0662118eee..b6cec201959 100644
--- a/dev-python/setproctitle/setproctitle-1.1.10-r1.ebuild
+++ b/dev-python/setproctitle/setproctitle-1.1.10-r1.ebuild
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
-PYTHON_COMPAT=( python3_{6..9} )
+PYTHON_COMPAT=( python3_{6..9} pypy3 )
 
 inherit distutils-r1 toolchain-funcs
 
@@ -13,21 +13,22 @@ SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
 LICENSE="BSD"
 SLOT="0"
 KEYWORDS="~alpha amd64 arm arm64 ~ia64 ppc ppc64 sparc x86 ~amd64-linux 
~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris 
~x64-solaris ~x86-solaris"
-IUSE="test"
-RESTRICT="!test? ( test )"
 
-RDEPEND=""
-DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
-       test? ( dev-python/nose[${PYTHON_USEDEP}] )"
-
-# Required for re-write of test suite
-DISTUTILS_IN_SOURCE_BUILD=1
+python_configure_all() {
+       2to3 -w --no-diffs tests || die
+}
 
 python_test() {
-       # prepare embedded executable
-       emake \
-               CC="$(tc-getCC)" \
-               PYINC="$(python_get_CFLAGS)" \
-               PYLIB="$(python_get_LIBS)" \
-               check
+       if [[ ${EPYTHON} != pypy* ]]; then
+               # prepare executable for embedded interpreter test
+               # (skipped with pypy)
+               rm -f tests/pyrun3 || die
+               emake \
+                       CC="$(tc-getCC)" \
+                       PYINC="$(python_get_CFLAGS)" \
+                       PYLIB="$(python_get_LIBS)" \
+                       tests/pyrun3
+       fi
+
+       "${EPYTHON}" tests/setproctitle_test.py -v || die "Tests failed with 
${EPYTHON}"
 }

Reply via email to