commit:     9ca86cb31b2ddf3740a4e9ee11437f5f09a49ce8
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 27 19:48:41 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Apr 27 19:48:41 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9ca86cb3

dev-python/python-distutils-extra: Fix tests

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

 .../files/python-distutils-extra-2.44-test.patch   | 27 ++++++++++++++++++++++
 .../python-distutils-extra-2.44.ebuild             | 15 ++++++++----
 2 files changed, 37 insertions(+), 5 deletions(-)

diff --git 
a/dev-python/python-distutils-extra/files/python-distutils-extra-2.44-test.patch
 
b/dev-python/python-distutils-extra/files/python-distutils-extra-2.44-test.patch
new file mode 100644
index 00000000000..b00fc32d017
--- /dev/null
+++ 
b/dev-python/python-distutils-extra/files/python-distutils-extra-2.44-test.patch
@@ -0,0 +1,27 @@
+From 33026583f3b2f59bcc415fae4c1ae84bfd058817 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <[email protected]>
+Date: Mon, 27 Apr 2020 21:25:37 +0200
+Subject: [PATCH] test: Find .egg-info file rather than guessing path (wrong)
+
+---
+ test/auto.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/test/auto.py b/test/auto.py
+index b9644ba..1d605e6 100755
+--- a/test/auto.py
++++ b/test/auto.py
+@@ -734,7 +734,9 @@ print ('import iamnota.module')
+         # parse .egg-info
+         (o, e, s) = self.setup_py(['install_egg_info', '-d', 
self.install_tree])
+         self.assertEqual(e, 'ERROR: Python module unknown not found\n')
+-        egg = self._installed_contents('foo-0.1.egg-info').splitlines()
++        egg_paths = [x for x in inst if x.endswith('.egg-info')]
++        self.assertEqual(len(egg_paths), 1)
++        egg = 
self._installed_contents(egg_paths[0].strip(os.path.sep)).splitlines()
+         self.assertIn('Name: foo', egg)
+ 
+         # check provides
+-- 
+2.26.2
+

diff --git 
a/dev-python/python-distutils-extra/python-distutils-extra-2.44.ebuild 
b/dev-python/python-distutils-extra/python-distutils-extra-2.44.ebuild
index c279a3684ff..8952cf77dcd 100644
--- a/dev-python/python-distutils-extra/python-distutils-extra-2.44.ebuild
+++ b/dev-python/python-distutils-extra/python-distutils-extra-2.44.ebuild
@@ -18,14 +18,19 @@ SRC_URI="
 LICENSE="GPL-2+"
 SLOT="0"
 KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
 
 DOCS=( doc/{README,FAQ} )
 
-src_prepare() {
-       sed -e 's:test_requires_provides:_&:' \
-               -i test/auto.py || die
-       distutils-r1_src_prepare
-}
+BDEPEND="
+       dev-libs/gobject-introspection
+       dev-python/httplib2
+       dev-python/pygobject"
+
+PATCHES=(
+       "${FILESDIR}"/python-distutils-extra-2.44-test.patch
+)
 
 python_test() {
        unset PYTHONDONTWRITEBYTECODE

Reply via email to