Gentoo Archives: gentoo-commits

From: Alessandro Barbieri <lssndrbarbieri@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: dev-python/pifpaf/files/, dev-python/pifpaf/
Date: Sun, 26 Sep 2021 18:37:17
Message-Id: 1632681429.f3e3736f648ce6f3cecbbf13147063fd21cbebdb.Alessandro-Barbieri@gentoo
1 commit: f3e3736f648ce6f3cecbbf13147063fd21cbebdb
2 Author: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
3 AuthorDate: Sun Sep 26 17:30:36 2021 +0000
4 Commit: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
5 CommitDate: Sun Sep 26 18:37:09 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=f3e3736f
7
8 dev-python/pifpaf: initial import
9
10 Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>
11
12 dev-python/pifpaf/Manifest | 1 +
13 .../testrepository-0.0.20-test-backport.patch | 62 ++++++++++++++++++++++
14 .../testrepository-0.0.20-test-backport1.patch | 16 ++++++
15 .../testrepository-0.0.20-test-backport2.patch | 49 +++++++++++++++++
16 dev-python/pifpaf/metadata.xml | 15 ++++++
17 dev-python/pifpaf/pifpaf-3.1.5.ebuild | 42 +++++++++++++++
18 6 files changed, 185 insertions(+)
19
20 diff --git a/dev-python/pifpaf/Manifest b/dev-python/pifpaf/Manifest
21 new file mode 100644
22 index 000000000..11ae766bb
23 --- /dev/null
24 +++ b/dev-python/pifpaf/Manifest
25 @@ -0,0 +1 @@
26 +DIST pifpaf-3.1.5.tar.gz 189903 BLAKE2B 5742e995feeb91af41db20cc605e8a5f5f21f63281d4f66ba8b108310a88d716ab4be0a43e0371f10e7f3f42b693953b3344c648458999348b914e03abe462c8 SHA512 4e0f70740f8260cb3cf801ea97f1fa30e6b87cfc4112b5482389d0635e76bbc7f1561945397e4e6586116c49d11b1e8f721dd61dca82668833bf224f9ba3e94f
27
28 diff --git a/dev-python/pifpaf/files/testrepository-0.0.20-test-backport.patch b/dev-python/pifpaf/files/testrepository-0.0.20-test-backport.patch
29 new file mode 100644
30 index 000000000..d7ab87c06
31 --- /dev/null
32 +++ b/dev-python/pifpaf/files/testrepository-0.0.20-test-backport.patch
33 @@ -0,0 +1,62 @@
34 +From 8f8ab15fafdad6db850c84772323b32375b09285 Mon Sep 17 00:00:00 2001
35 +From: Robert Collins <robertc@×××××××××××××.net>
36 +Date: Tue, 10 Mar 2015 15:21:49 +1300
37 +Subject: [PATCH] Fixup tests with latest testtools.
38 +
39 +Testtools has started chunking exceptions (which is perhaps good,
40 +perhaps bad) - but we shouldn't depend on the exact behaviour in it
41 +for our tests.
42 +--- a/NEWS
43 ++++ b/NEWS
44 +@@ -5,6 +5,12 @@ testrepository release notes
45 + NEXT (In development)
46 + +++++++++++++++++++++
47 +
48 ++CHANGES
49 ++-------
50 ++
51 ++* Isolate the testrepository test suite from the chunking (or otherwise)
52 ++ behaviour of testtools' exception handlers. (Robert Collins)
53 ++
54 + 0.0.20
55 + ++++++
56 +
57 +--- a/testrepository/tests/test_repository.py
58 ++++ b/testrepository/tests/test_repository.py
59 +@@ -28,6 +28,7 @@
60 + from testresources import TestResource
61 + from testtools import (
62 + clone_test_with_new_id,
63 ++ content,
64 + PlaceHolder,
65 + )
66 + import testtools
67 +@@ -103,19 +104,24 @@ class Case(ResourcedTestCase):
68 + def passing(self):
69 + pass
70 +
71 +- def failing(self):
72 +- self.fail("oops")
73 +-
74 + def unexpected_success(self):
75 + self.expectFailure("unexpected success", self.assertTrue, True)
76 +
77 +
78 ++class FailingCase:
79 ++
80 ++ def run(self, result):
81 ++ result.startTest(self)
82 ++ result.addError(
83 ++ self, None, details={'traceback': content.text_content("")})
84 ++ result.stopTest(self)
85 ++
86 + def make_test(id, should_pass):
87 + """Make a test."""
88 + if should_pass:
89 + case = Case("passing")
90 + else:
91 +- case = Case("failing")
92 ++ case = FailingCase()
93 + return clone_test_with_new_id(case, id)
94 +
95 +
96
97 diff --git a/dev-python/pifpaf/files/testrepository-0.0.20-test-backport1.patch b/dev-python/pifpaf/files/testrepository-0.0.20-test-backport1.patch
98 new file mode 100644
99 index 000000000..655d2c3e7
100 --- /dev/null
101 +++ b/dev-python/pifpaf/files/testrepository-0.0.20-test-backport1.patch
102 @@ -0,0 +1,16 @@
103 +From d3d6cac4fd42f2067c0dd81be748853f81c348fc Mon Sep 17 00:00:00 2001
104 +From: Robert Collins <robertc@×××××××××××××.net>
105 +Date: Sun, 12 Jul 2015 21:37:34 +1200
106 +Subject: [PATCH] Fix 3.3+ tests with nested classnames.
107 +
108 +--- a/testrepository/tests/ui/test_cli.py
109 ++++ b/testrepository/tests/ui/test_cli.py
110 +@@ -157,7 +157,7 @@ def method(self):
111 + self.assertThat(ui._stdout.buffer.getvalue().decode('utf8'),
112 + DocTestMatches("""\
113 + ======================================================================
114 +-FAIL: testrepository.tests.ui.test_cli.Case.method
115 ++FAIL: testrepository.tests.ui.test_cli...Case.method
116 + ----------------------------------------------------------------------
117 + ...Traceback (most recent call last):...
118 + File "...test_cli.py", line ..., in method
119
120 diff --git a/dev-python/pifpaf/files/testrepository-0.0.20-test-backport2.patch b/dev-python/pifpaf/files/testrepository-0.0.20-test-backport2.patch
121 new file mode 100644
122 index 000000000..69d591c2f
123 --- /dev/null
124 +++ b/dev-python/pifpaf/files/testrepository-0.0.20-test-backport2.patch
125 @@ -0,0 +1,49 @@
126 +From e2f84ae6b2bcf89221613056d0c45dd308f46d62 Mon Sep 17 00:00:00 2001
127 +From: =?UTF-8?q?Jelmer=20Vernoo=C4=B3?= <jelmer@××××××.uk>
128 +Date: Thu, 5 Apr 2018 01:02:40 +0100
129 +Subject: [PATCH] Fix the testrepository tests with newer versions of
130 + testtools.
131 +
132 +--- a/testrepository/tests/commands/test_failing.py
133 ++++ b/testrepository/tests/commands/test_failing.py
134 +@@ -90,7 +90,7 @@ class TestCommand(ResourcedTestCase):
135 + finally:
136 + log.stopTestRun()
137 + self.assertEqual(
138 +- log._events, [
139 ++ [tuple(ev) for ev in log._events], [
140 + ('startTestRun',),
141 + ('status', 'failing', 'inprogress', None, True, None, None, False,
142 + None, None, Wildcard),
143 +--- a/testrepository/tests/test_repository.py
144 ++++ b/testrepository/tests/test_repository.py
145 +@@ -113,9 +113,10 @@ class FailingCase:
146 + def run(self, result):
147 + result.startTest(self)
148 + result.addError(
149 +- self, None, details={'traceback': content.text_content("")})
150 ++ self, None, details={'traceback': content.text_content("tb")})
151 + result.stopTest(self)
152 +
153 ++
154 + def make_test(id, should_pass):
155 + """Make a test."""
156 + if should_pass:
157 +@@ -409,7 +410,7 @@ class TestRepositoryContract(ResourcedTestCase):
158 + finally:
159 + log.stopTestRun()
160 + self.assertEqual(
161 +- log._events, [
162 ++ [tuple(ev) for ev in log._events], [
163 + ('startTestRun',),
164 + ('status',
165 + 'testrepository.tests.test_repository.Case.method',
166 +@@ -465,7 +466,7 @@ class TestRepositoryContract(ResourcedTestCase):
167 + finally:
168 + log.stopTestRun()
169 + self.assertEqual(
170 +- log._events,
171 ++ [tuple(ev) for ev in log._events],
172 + [
173 + ('startTestRun',),
174 + ('status',
175
176 diff --git a/dev-python/pifpaf/metadata.xml b/dev-python/pifpaf/metadata.xml
177 new file mode 100644
178 index 000000000..ce63cf84c
179 --- /dev/null
180 +++ b/dev-python/pifpaf/metadata.xml
181 @@ -0,0 +1,15 @@
182 +<?xml version="1.0" encoding="UTF-8"?>
183 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
184 +<pkgmetadata>
185 + <maintainer type="person">
186 + <email>lssndrbarbieri@×××××.com</email>
187 + <name>Alessandro Barbieri</name>
188 + </maintainer>
189 + <longdescription lang="en">
190 +Pifpaf is a suite of fixtures and a command-line tool that allows to start and stop daemons for a quick throw-away usage. This is typically useful when needing these daemons to run integration testing. It originaly evolved from its precussor overtest.
191 + </longdescription>
192 + <upstream>
193 + <remote-id type="github">jd/pifpaf</remote-id>
194 + <remote-id type="pypi">pifpaf</remote-id>
195 + </upstream>
196 +</pkgmetadata>
197
198 diff --git a/dev-python/pifpaf/pifpaf-3.1.5.ebuild b/dev-python/pifpaf/pifpaf-3.1.5.ebuild
199 new file mode 100644
200 index 000000000..204ad2584
201 --- /dev/null
202 +++ b/dev-python/pifpaf/pifpaf-3.1.5.ebuild
203 @@ -0,0 +1,42 @@
204 +# Copyright 1999-2021 Gentoo Authors
205 +# Distributed under the terms of the GNU General Public License v2
206 +
207 +EAPI=8
208 +
209 +EPYTEST_DESELECT=( pifpaf/tests/test_cli.py::TestCli::test_non_existing_command )
210 +PYTHON_COMPAT=( python3_8 )
211 +
212 +inherit distutils-r1
213 +
214 +DESCRIPTION="Python fixtures and daemon managing tools for functional testing"
215 +HOMEPAGE="
216 + https://pypi.org/project/pifpaf
217 + https://github.com/jd/pifpaf
218 +"
219 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
220 +
221 +LICENSE="Apache-2.0"
222 +SLOT="0"
223 +KEYWORDS="~amd64"
224 +
225 +RDEPEND="
226 + dev-python/daiquiri[${PYTHON_USEDEP}]
227 + dev-python/click[${PYTHON_USEDEP}]
228 + dev-python/pbr[${PYTHON_USEDEP}]
229 + dev-python/jinja[${PYTHON_USEDEP}]
230 + dev-python/fixtures[${PYTHON_USEDEP}]
231 + dev-python/psutil[${PYTHON_USEDEP}]
232 + dev-python/pyxattr[${PYTHON_USEDEP}]
233 +"
234 +DEPEND="
235 + ${RDEPEND}
236 + dev-python/pbr[${PYTHON_USEDEP}]
237 + test? (
238 + dev-python/requests[${PYTHON_USEDEP}]
239 + dev-python/testrepository[${PYTHON_USEDEP}]
240 + dev-python/testtools[${PYTHON_USEDEP}]
241 + dev-python/mock[${PYTHON_USEDEP}]
242 + )
243 +"
244 +
245 +distutils_enable_tests pytest