commit:     8b853e9493dd53d8d6477d8c0e39eb690e2269b8
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Apr  9 19:12:14 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Apr  9 19:12:14 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8b853e94

dev-python/zope-exceptions: Fix tests, remove namespace dep

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

 .../zope-exceptions/zope-exceptions-4.5.ebuild     | 34 +++++++++++++++-------
 1 file changed, 24 insertions(+), 10 deletions(-)

diff --git a/dev-python/zope-exceptions/zope-exceptions-4.5.ebuild 
b/dev-python/zope-exceptions/zope-exceptions-4.5.ebuild
index 8d9aedf70fd5..7e70344cb57e 100644
--- a/dev-python/zope-exceptions/zope-exceptions-4.5.ebuild
+++ b/dev-python/zope-exceptions/zope-exceptions-4.5.ebuild
@@ -12,7 +12,8 @@ MY_P=${P/-/.}
 DESCRIPTION="General purpose exceptions for Zope packages"
 HOMEPAGE="
        https://pypi.org/project/zope.exceptions/
-       https://github.com/zopefoundation/zope.exceptions/";
+       https://github.com/zopefoundation/zope.exceptions/
+"
 SRC_URI="mirror://pypi/${PN::1}/${PN/-/.}/${MY_P}.tar.gz"
 S="${WORKDIR}/${MY_P}"
 
@@ -21,16 +22,29 @@ SLOT="0"
 KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
 
 RDEPEND="
-       dev-python/namespace-zope[${PYTHON_USEDEP}]
-       dev-python/zope-interface[${PYTHON_USEDEP}]"
-BDEPEND="
-       test? ( dev-python/zope-testrunner[${PYTHON_USEDEP}] )"
+       dev-python/zope-interface[${PYTHON_USEDEP}]
+"
 
-distutils_enable_tests setup.py
+distutils_enable_tests unittest
 
-python_install_all() {
-       distutils-r1_python_install_all
+src_prepare() {
+       # strip rdep specific to namespaces
+       sed -i -e "/'setuptools'/d" setup.py || die
+       distutils-r1_src_prepare
+}
+
+python_compile() {
+       distutils-r1_python_compile
+       find "${BUILD_DIR}" -name '*.pth' -delete || die
+}
 
-       # remove .pth files since dev-python/namespace-zope handles the ns
-       find "${D}" -name '*.pth' -delete || die
+python_test() {
+       cd "${BUILD_DIR}/install$(python_get_sitedir)" || die
+       # this is needed to keep the tests working while
+       # dev-python/namespace-zope is still installed
+       cat > zope/__init__.py <<-EOF || die
+               __path__ = __import__('pkgutil').extend_path(__path__, __name__)
+       EOF
+       eunittest
+       rm zope/__init__.py || die
 }

Reply via email to