Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pytest-twisted/
Date: Fri, 26 Aug 2022 11:38:23
Message-Id: 1661513892.43e960831dcf4bd231453f9b223e5f03e321f861.sam@gentoo
1 commit: 43e960831dcf4bd231453f9b223e5f03e321f861
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Fri Aug 26 11:37:16 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Fri Aug 26 11:38:12 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=43e96083
7
8 dev-python/pytest-twisted: fix disabling autoload
9
10 Need to do it in src_prepare before the wheel is created
11 (the old hack doesn't work for PEP517 builds).
12
13 With the fix (ignore lack of revision as did it after):
14 ```
15 * CMP: =dev-python/pytest-twisted-1.13.4 with dev-python/pytest-twisted-1.13.4/image
16 * FILES:-usr/lib/python3.10/site-packages/pytest_twisted-*.dist-info/entry_points.txt
17 * FILES:-usr/lib/python3.11/site-packages/pytest_twisted-*.dist-info/entry_points.txt
18 * FILES:-usr/lib/python3.8/site-packages/pytest_twisted-*.dist-info/entry_points.txt
19 * FILES:-usr/lib/python3.9/site-packages/pytest_twisted-*.dist-info/entry_points.txt
20 * SIZE: 0.28MiB -> 0.28MiB, 37 -> 33 files
21 * ------> FILES(-4) SIZE(-0.22%)
22 ```
23
24 Closes: https://bugs.gentoo.org/866677
25 Signed-off-by: Sam James <sam <AT> gentoo.org>
26
27 ...-1.13.4.ebuild => pytest-twisted-1.13.4-r1.ebuild} | 19 +++++++++----------
28 1 file changed, 9 insertions(+), 10 deletions(-)
29
30 diff --git a/dev-python/pytest-twisted/pytest-twisted-1.13.4.ebuild b/dev-python/pytest-twisted/pytest-twisted-1.13.4-r1.ebuild
31 similarity index 93%
32 rename from dev-python/pytest-twisted/pytest-twisted-1.13.4.ebuild
33 rename to dev-python/pytest-twisted/pytest-twisted-1.13.4-r1.ebuild
34 index 9f14cee4b540..c855d5fd9c88 100644
35 --- a/dev-python/pytest-twisted/pytest-twisted-1.13.4.ebuild
36 +++ b/dev-python/pytest-twisted/pytest-twisted-1.13.4-r1.ebuild
37 @@ -25,6 +25,12 @@ RDEPEND="
38 distutils_enable_tests pytest
39
40 src_prepare() {
41 + # If we let pytest-twisted autoload everywhere, it breaks tests in
42 + # packages that don't expect it. Apply a similar hack as for bug
43 + # #661218. We can't do this in src_prepare() because the tests need
44 + # autoloading enabled.
45 + sed -e 's/"pytest11": \[[^]]*\]//' -i setup.py || die
46 +
47 # https://github.com/pytest-dev/pytest/issues/9280
48 sed -e '/^pytest_plugins =/d' -i testing/conftest.py || die
49
50 @@ -32,15 +38,8 @@ src_prepare() {
51 }
52
53 python_test() {
54 - epytest -p pytester
55 -}
56 + local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
57 + local -x PYTEST_PLUGINS=pytest_twisted
58
59 -src_install() {
60 - # If we let pytest-twisted autoload everywhere, it breaks tests in
61 - # packages that don't expect it. Apply a similar hack as for bug
62 - # #661218. We can't do this in src_prepare() because the tests need
63 - # autoloading enabled.
64 - sed -e 's/"pytest11": \[[^]]*\]//' -i setup.py || die
65 -
66 - distutils-r1_src_install
67 + epytest -p pytester
68 }