commit:     25fb81458668d3f0c2d68b49ba79048bc752587d
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Feb  4 18:29:46 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Feb  4 18:32:23 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=25fb8145

dev-python/jaraco-itertools: Fix ns-caused import failures

Closes: https://bugs.gentoo.org/832714
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/jaraco-itertools/jaraco-itertools-6.0.3.ebuild | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/dev-python/jaraco-itertools/jaraco-itertools-6.0.3.ebuild 
b/dev-python/jaraco-itertools/jaraco-itertools-6.0.3.ebuild
index db86fa022f88..68c9258b26b8 100644
--- a/dev-python/jaraco-itertools/jaraco-itertools-6.0.3.ebuild
+++ b/dev-python/jaraco-itertools/jaraco-itertools-6.0.3.ebuild
@@ -31,7 +31,11 @@ distutils_enable_tests pytest
 export SETUPTOOLS_SCM_PRETEND_VERSION=${PV}
 
 python_test() {
-       # needed for doctests to work
-       > jaraco/__init__.py || die
+       # create a pkgutil-style __init__.py in order to fix pytest's
+       # determination of package paths
+       cat > jaraco/__init__.py <<-EOF || die
+               __path__ = __import__('pkgutil').extend_path(__path__, __name__)
+       EOF
        epytest --doctest-modules
+       rm jaraco/__init__.py || die
 }

Reply via email to