Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/zope-exceptions/
Date: Sat, 09 Apr 2022 19:12:46
Message-Id: 1649531534.8b853e9493dd53d8d6477d8c0e39eb690e2269b8.mgorny@gentoo
1 commit: 8b853e9493dd53d8d6477d8c0e39eb690e2269b8
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sat Apr 9 19:12:14 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sat Apr 9 19:12:14 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8b853e94
7
8 dev-python/zope-exceptions: Fix tests, remove namespace dep
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 .../zope-exceptions/zope-exceptions-4.5.ebuild | 34 +++++++++++++++-------
13 1 file changed, 24 insertions(+), 10 deletions(-)
14
15 diff --git a/dev-python/zope-exceptions/zope-exceptions-4.5.ebuild b/dev-python/zope-exceptions/zope-exceptions-4.5.ebuild
16 index 8d9aedf70fd5..7e70344cb57e 100644
17 --- a/dev-python/zope-exceptions/zope-exceptions-4.5.ebuild
18 +++ b/dev-python/zope-exceptions/zope-exceptions-4.5.ebuild
19 @@ -12,7 +12,8 @@ MY_P=${P/-/.}
20 DESCRIPTION="General purpose exceptions for Zope packages"
21 HOMEPAGE="
22 https://pypi.org/project/zope.exceptions/
23 - https://github.com/zopefoundation/zope.exceptions/"
24 + https://github.com/zopefoundation/zope.exceptions/
25 +"
26 SRC_URI="mirror://pypi/${PN::1}/${PN/-/.}/${MY_P}.tar.gz"
27 S="${WORKDIR}/${MY_P}"
28
29 @@ -21,16 +22,29 @@ SLOT="0"
30 KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
31
32 RDEPEND="
33 - dev-python/namespace-zope[${PYTHON_USEDEP}]
34 - dev-python/zope-interface[${PYTHON_USEDEP}]"
35 -BDEPEND="
36 - test? ( dev-python/zope-testrunner[${PYTHON_USEDEP}] )"
37 + dev-python/zope-interface[${PYTHON_USEDEP}]
38 +"
39
40 -distutils_enable_tests setup.py
41 +distutils_enable_tests unittest
42
43 -python_install_all() {
44 - distutils-r1_python_install_all
45 +src_prepare() {
46 + # strip rdep specific to namespaces
47 + sed -i -e "/'setuptools'/d" setup.py || die
48 + distutils-r1_src_prepare
49 +}
50 +
51 +python_compile() {
52 + distutils-r1_python_compile
53 + find "${BUILD_DIR}" -name '*.pth' -delete || die
54 +}
55
56 - # remove .pth files since dev-python/namespace-zope handles the ns
57 - find "${D}" -name '*.pth' -delete || die
58 +python_test() {
59 + cd "${BUILD_DIR}/install$(python_get_sitedir)" || die
60 + # this is needed to keep the tests working while
61 + # dev-python/namespace-zope is still installed
62 + cat > zope/__init__.py <<-EOF || die
63 + __path__ = __import__('pkgutil').extend_path(__path__, __name__)
64 + EOF
65 + eunittest
66 + rm zope/__init__.py || die
67 }