Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/python-systemd/files/, dev-python/python-systemd/
Date: Sat, 24 Sep 2016 14:11:40
Message-Id: 1474726293.7d1d316ce9552c6388a91e98a817aa2b522a615d.floppym@gentoo
1 commit: 7d1d316ce9552c6388a91e98a817aa2b522a615d
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 24 14:08:06 2016 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 24 14:11:33 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d1d316c
7
8 dev-python/python-systemd: bump to 232
9
10 Package-Manager: portage-2.3.1_p4
11
12 dev-python/python-systemd/Manifest | 1 +
13 ...sts-skip-fdstore-tests-if-not-implemented.patch | 63 ++++++++++++++++++++++
14 .../232-0002-docs-fix-sphinx-format-warning.patch | 30 +++++++++++
15 .../232-0003-build-sys-add-doc-sync-target.patch | 29 ++++++++++
16 ...orkaround-for-pre-232-system-returning-EI.patch | 58 ++++++++++++++++++++
17 ...-proper-ifdef-guard-for-sd_j_open_files_f.patch | 55 +++++++++++++++++++
18 ...uild-sys-import-pytest-instead-of-py.test.patch | 27 ++++++++++
19 .../python-systemd/python-systemd-232.ebuild | 42 +++++++++++++++
20 8 files changed, 305 insertions(+)
21
22 diff --git a/dev-python/python-systemd/Manifest b/dev-python/python-systemd/Manifest
23 index 57c069e..b1907d1 100644
24 --- a/dev-python/python-systemd/Manifest
25 +++ b/dev-python/python-systemd/Manifest
26 @@ -1,2 +1,3 @@
27 DIST python-systemd-230.tar.gz 39329 SHA256 656a83ff695f5de7d63411a86ea38601ad5a918595eebd0817d7b8e68642c64d SHA512 3c26c59b9005a45c3aeea8a6838ece9b5aa27dd7394ebe75319c1536b52462a847f18a79fdc8cf3bf6df9a70af63c84d5ff66a9587519dd9a006cc3df4966ce8 WHIRLPOOL 0de7ff6919bdf1c6c9cdafd71944801396157281fae1583bb060da4cf800369f97bb0c9f484f81635ed8b2e170db2bbbecf59adac0470a910167333f93c607e6
28 DIST python-systemd-231.tar.gz 44430 SHA256 2c9cf53d041374898beead0c6f3b042c7d5b52425e6eb4d4b3c583d7eac12eea SHA512 b1567bd8e99025cc3b5aaeaab6539af8a5307068c403c0f1628bebc518ded80d0843b804244d1f252c858229f7f9578ce9aa988ded25f55999b0d355ce8a3455 WHIRLPOOL 4a1e05687080e8613ae607f837f39672727e60fc7bca1bca445f46413ce16280ab3bfaa30e969414d0da41f06420b7ef59043d2624dc50342cbe2d6df6add449
29 +DIST python-systemd-232.tar.gz 49211 SHA256 fc904704faa3dc2888a7336f1c660329c152fd4afb583267ef5d63c4a7f663a1 SHA512 3dfe8a17cd52fdcfce519ff1a64989ba153107d64839c95f93d8266239ed57d0d3510616726a1ab14dfa1b6df8216dc1d8e337d6240d1350378ec58148336325 WHIRLPOOL 34d2d0d1e11575b7fd6497f0543265542bbf7d68dd5a1a3e1c036e5a2518709254d04ee73794d72cb4c51d8f769079cede702fe61d1db7baa4993c213b8e9c2d
30
31 diff --git a/dev-python/python-systemd/files/232-0001-tests-skip-fdstore-tests-if-not-implemented.patch b/dev-python/python-systemd/files/232-0001-tests-skip-fdstore-tests-if-not-implemented.patch
32 new file mode 100644
33 index 00000000..ab8affd
34 --- /dev/null
35 +++ b/dev-python/python-systemd/files/232-0001-tests-skip-fdstore-tests-if-not-implemented.patch
36 @@ -0,0 +1,63 @@
37 +From 177ac6d894e362b0d22a2765db280abed71cc07f Mon Sep 17 00:00:00 2001
38 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@××××××.pl>
39 +Date: Thu, 22 Sep 2016 07:46:59 -0400
40 +Subject: [PATCH 1/6] tests: skip fdstore tests if not implemented
41 +
42 +Should fix #12.
43 +---
44 + systemd/test/test_daemon.py | 18 +++++++++++++++---
45 + 1 file changed, 15 insertions(+), 3 deletions(-)
46 +
47 +diff --git a/systemd/test/test_daemon.py b/systemd/test/test_daemon.py
48 +index 215f1f8..e827e1d 100644
49 +--- a/systemd/test/test_daemon.py
50 ++++ b/systemd/test/test_daemon.py
51 +@@ -16,6 +16,15 @@ from systemd.daemon import (booted,
52 + import pytest
53 +
54 + @contextlib.contextmanager
55 ++def skip_enosys():
56 ++ try:
57 ++ yield
58 ++ except OSError as e:
59 ++ if e.errno == errno.ENOSYS:
60 ++ pytest.skip()
61 ++ raise
62 ++
63 ++@××××××××××.contextmanager
64 + def closing_socketpair(family):
65 + pair = socket.socketpair(family)
66 + try:
67 +@@ -200,7 +209,8 @@ def test_listen_fds_default_unset():
68 +
69 + def test_notify_no_socket():
70 + assert notify('READY=1') == False
71 +- assert notify('FDSTORE=1', fds=[]) == False
72 ++ with skip_enosys():
73 ++ assert notify('FDSTORE=1', fds=[]) == False
74 + assert notify('FDSTORE=1', fds=[1,2]) == False
75 + assert notify('FDSTORE=1', pid=os.getpid()) == False
76 + assert notify('FDSTORE=1', pid=os.getpid(), fds=(1,)) == False
77 +@@ -216,7 +226,8 @@ def test_notify_bad_socket():
78 + with pytest.raises(connection_error):
79 + notify('READY=1')
80 + with pytest.raises(connection_error):
81 +- notify('FDSTORE=1', fds=[])
82 ++ with skip_enosys():
83 ++ notify('FDSTORE=1', fds=[])
84 + with pytest.raises(connection_error):
85 + notify('FDSTORE=1', fds=[1,2])
86 + with pytest.raises(connection_error):
87 +@@ -234,7 +245,8 @@ def test_notify_with_socket(tmpdir):
88 + os.environ['NOTIFY_SOCKET'] = path
89 +
90 + assert notify('READY=1') == True
91 +- assert notify('FDSTORE=1', fds=[]) == True
92 ++ with skip_enosys():
93 ++ assert notify('FDSTORE=1', fds=[]) == True
94 + assert notify('FDSTORE=1', fds=[1,2]) == True
95 + assert notify('FDSTORE=1', pid=os.getpid()) == True
96 + assert notify('FDSTORE=1', pid=os.getpid(), fds=(1,)) == True
97 +--
98 +2.10.0
99 +
100
101 diff --git a/dev-python/python-systemd/files/232-0002-docs-fix-sphinx-format-warning.patch b/dev-python/python-systemd/files/232-0002-docs-fix-sphinx-format-warning.patch
102 new file mode 100644
103 index 00000000..d7fa5f3
104 --- /dev/null
105 +++ b/dev-python/python-systemd/files/232-0002-docs-fix-sphinx-format-warning.patch
106 @@ -0,0 +1,30 @@
107 +From b9767792b97fe56b37bb59ee3d207ae359f1651c Mon Sep 17 00:00:00 2001
108 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@××××××.pl>
109 +Date: Thu, 22 Sep 2016 09:52:58 -0400
110 +Subject: [PATCH 2/6] docs: fix sphinx format warning
111 +
112 +build/lib.linux-x86_64-3.5/systemd/journal.py:docstring of systemd.journal.stream:15: WARNING: Literal block expected; none found.
113 +---
114 + systemd/journal.py | 6 +++---
115 + 1 file changed, 3 insertions(+), 3 deletions(-)
116 +
117 +diff --git a/systemd/journal.py b/systemd/journal.py
118 +index e930164..a74d62f 100644
119 +--- a/systemd/journal.py
120 ++++ b/systemd/journal.py
121 +@@ -461,9 +461,9 @@ def stream(identifier, priority=LOG_DEBUG, level_prefix=False):
122 +
123 + will produce the following message in the journal::
124 +
125 +- PRIORITY=7
126 +- SYSLOG_IDENTIFIER=myapp
127 +- MESSAGE=message...
128 ++ PRIORITY=7
129 ++ SYSLOG_IDENTIFIER=myapp
130 ++ MESSAGE=message...
131 +
132 + Using the interface with print might be more convenient:
133 +
134 +--
135 +2.10.0
136 +
137
138 diff --git a/dev-python/python-systemd/files/232-0003-build-sys-add-doc-sync-target.patch b/dev-python/python-systemd/files/232-0003-build-sys-add-doc-sync-target.patch
139 new file mode 100644
140 index 00000000..08b4b29
141 --- /dev/null
142 +++ b/dev-python/python-systemd/files/232-0003-build-sys-add-doc-sync-target.patch
143 @@ -0,0 +1,29 @@
144 +From c3c412f90e481b88ca897e8542ced207c445c757 Mon Sep 17 00:00:00 2001
145 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@××××××.pl>
146 +Date: Thu, 22 Sep 2016 09:59:04 -0400
147 +Subject: [PATCH 3/6] build-sys: add doc-sync target
148 +
149 +---
150 + Makefile | 6 +++++-
151 + 1 file changed, 5 insertions(+), 1 deletion(-)
152 +
153 +diff --git a/Makefile b/Makefile
154 +index df0555c..23b452e 100644
155 +--- a/Makefile
156 ++++ b/Makefile
157 +@@ -53,7 +53,11 @@ sphinx-%: build
158 + check: build
159 + (cd $(builddir) && $(PYTHON) -m py.test . ../../docs $(TESTFLAGS))
160 +
161 ++www_target = www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd/python-systemd
162 ++doc-sync:
163 ++ rsync -rlv --delete --omit-dir-times build/html/ $(www_target)/
164 ++
165 + TAGS: $(shell git ls-files systemd/*.[ch])
166 + $(ETAGS) $+
167 +
168 +-.PHONY: build install dist clean distclean TAGS
169 ++.PHONY: build install dist clean distclean TAGS doc-sync
170 +--
171 +2.10.0
172 +
173
174 diff --git a/dev-python/python-systemd/files/232-0004-tests-add-workaround-for-pre-232-system-returning-EI.patch b/dev-python/python-systemd/files/232-0004-tests-add-workaround-for-pre-232-system-returning-EI.patch
175 new file mode 100644
176 index 00000000..fd43b46
177 --- /dev/null
178 +++ b/dev-python/python-systemd/files/232-0004-tests-add-workaround-for-pre-232-system-returning-EI.patch
179 @@ -0,0 +1,58 @@
180 +From 35a5b281adea321ea3f7b7d688a994e735366fb0 Mon Sep 17 00:00:00 2001
181 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@××××××.pl>
182 +Date: Thu, 22 Sep 2016 20:12:15 -0400
183 +Subject: [PATCH 4/6] tests: add workaround for pre-232 system returning EINVAL
184 + on some flags
185 +
186 +---
187 + systemd/test/test_journal.py | 20 +++++++++++++++-----
188 + 1 file changed, 15 insertions(+), 5 deletions(-)
189 +
190 +diff --git a/systemd/test/test_journal.py b/systemd/test/test_journal.py
191 +index 0902183..dceec3f 100644
192 +--- a/systemd/test/test_journal.py
193 ++++ b/systemd/test/test_journal.py
194 +@@ -21,6 +21,13 @@ def skip_enosys():
195 + pytest.skip()
196 + raise
197 +
198 ++@××××××××××.contextmanager
199 ++def skip_valueerror():
200 ++ try:
201 ++ yield
202 ++ except ValueError:
203 ++ pytest.skip()
204 ++
205 + def test_priorities():
206 + p = journal.JournalHandler.mapPriority
207 +
208 +@@ -62,10 +69,12 @@ def test_reader_init_flags():
209 + def test_reader_os_root(tmpdir):
210 + with pytest.raises(ValueError):
211 + journal.Reader(journal.OS_ROOT)
212 +- j1 = journal.Reader(path=tmpdir.strpath,
213 +- flags=journal.OS_ROOT)
214 +- j2 = journal.Reader(path=tmpdir.strpath,
215 +- flags=journal.OS_ROOT | journal.CURRENT_USER)
216 ++ with skip_valueerror():
217 ++ j1 = journal.Reader(path=tmpdir.strpath,
218 ++ flags=journal.OS_ROOT)
219 ++ with skip_valueerror():
220 ++ j2 = journal.Reader(path=tmpdir.strpath,
221 ++ flags=journal.OS_ROOT | journal.CURRENT_USER)
222 + j3 = journal.Reader(path=tmpdir.strpath,
223 + flags=journal.OS_ROOT | journal.SYSTEM_ONLY)
224 +
225 +@@ -91,7 +100,8 @@ def test_reader_init_path_fd(tmpdir):
226 + j1 = journal.Reader(path=fd)
227 + assert list(j1) == []
228 +
229 +- j2 = journal.Reader(journal.SYSTEM, path=fd)
230 ++ with skip_valueerror():
231 ++ j2 = journal.Reader(journal.SYSTEM, path=fd)
232 + assert list(j2) == []
233 +
234 + j3 = journal.Reader(journal.CURRENT_USER, path=fd)
235 +--
236 +2.10.0
237 +
238
239 diff --git a/dev-python/python-systemd/files/232-0005-_reader-use-proper-ifdef-guard-for-sd_j_open_files_f.patch b/dev-python/python-systemd/files/232-0005-_reader-use-proper-ifdef-guard-for-sd_j_open_files_f.patch
240 new file mode 100644
241 index 00000000..b751f2d
242 --- /dev/null
243 +++ b/dev-python/python-systemd/files/232-0005-_reader-use-proper-ifdef-guard-for-sd_j_open_files_f.patch
244 @@ -0,0 +1,55 @@
245 +From 8024fc61719d15b47ace1973b6b901881e17ff2f Mon Sep 17 00:00:00 2001
246 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@××××××.pl>
247 +Date: Thu, 22 Sep 2016 20:41:21 -0400
248 +Subject: [PATCH 5/6] _reader: use proper ifdef guard for sd_j_open_files_fd
249 +
250 +---
251 + systemd/_reader.c | 10 +++++++---
252 + 1 file changed, 7 insertions(+), 3 deletions(-)
253 +
254 +diff --git a/systemd/_reader.c b/systemd/_reader.c
255 +index 0f6fd3f..3a2c218 100644
256 +--- a/systemd/_reader.c
257 ++++ b/systemd/_reader.c
258 +@@ -283,7 +283,6 @@ static int Reader_init(Reader *self, PyObject *args, PyObject *keywds) {
259 + Py_END_ALLOW_THREADS
260 + }
261 + } else if (_files) {
262 +-#ifdef HAVE_JOURNAL_OPEN_FILES
263 + _cleanup_Py_DECREF_ PyObject *item0 = NULL;
264 +
265 + item0 = PySequence_GetItem(_files, 0);
266 +@@ -293,9 +292,13 @@ static int Reader_init(Reader *self, PyObject *args, PyObject *keywds) {
267 + if (!strv_converter(_files, &files))
268 + return -1;
269 +
270 ++#ifdef HAVE_JOURNAL_OPEN_FILES
271 + Py_BEGIN_ALLOW_THREADS
272 + r = sd_journal_open_files(&self->j, (const char**) files, flags);
273 + Py_END_ALLOW_THREADS
274 ++#else
275 ++ r = -ENOSYS;
276 ++#endif
277 + } else {
278 + _cleanup_free_ int *fds = NULL;
279 + size_t n_fds;
280 +@@ -303,13 +306,14 @@ static int Reader_init(Reader *self, PyObject *args, PyObject *keywds) {
281 + if (!intlist_converter(_files, &fds, &n_fds))
282 + return -1;
283 +
284 ++#ifdef HAVE_JOURNAL_OPEN_DIRECTORY_FD
285 + Py_BEGIN_ALLOW_THREADS
286 + r = sd_journal_open_files_fd(&self->j, fds, n_fds, flags);
287 + Py_END_ALLOW_THREADS
288 +- }
289 + #else
290 +- r = -ENOSYS;
291 ++ r = -ENOSYS;
292 + #endif
293 ++ }
294 + } else {
295 + Py_BEGIN_ALLOW_THREADS
296 + r = sd_journal_open(&self->j, flags);
297 +--
298 +2.10.0
299 +
300
301 diff --git a/dev-python/python-systemd/files/232-0006-build-sys-import-pytest-instead-of-py.test.patch b/dev-python/python-systemd/files/232-0006-build-sys-import-pytest-instead-of-py.test.patch
302 new file mode 100644
303 index 00000000..04509ab
304 --- /dev/null
305 +++ b/dev-python/python-systemd/files/232-0006-build-sys-import-pytest-instead-of-py.test.patch
306 @@ -0,0 +1,27 @@
307 +From 911591a1188e03942e60f2ab1abf91562904f49e Mon Sep 17 00:00:00 2001
308 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@××××××.pl>
309 +Date: Thu, 22 Sep 2016 20:24:31 -0400
310 +Subject: [PATCH 6/6] build-sys: import "pytest" instead of "py.test"
311 +
312 +Fixes the following error in rawhide:
313 +/usr/bin/python3: loader for pytest cannot handle py.test
314 +---
315 + Makefile | 2 +-
316 + 1 file changed, 1 insertion(+), 1 deletion(-)
317 +
318 +diff --git a/Makefile b/Makefile
319 +index 23b452e..b10d6d9 100644
320 +--- a/Makefile
321 ++++ b/Makefile
322 +@@ -51,7 +51,7 @@ sphinx-%: build
323 + @echo Output has been generated in build/$*
324 +
325 + check: build
326 +- (cd $(builddir) && $(PYTHON) -m py.test . ../../docs $(TESTFLAGS))
327 ++ (cd $(builddir) && $(PYTHON) -m pytest . ../../docs $(TESTFLAGS))
328 +
329 + www_target = www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd/python-systemd
330 + doc-sync:
331 +--
332 +2.10.0
333 +
334
335 diff --git a/dev-python/python-systemd/python-systemd-232.ebuild b/dev-python/python-systemd/python-systemd-232.ebuild
336 new file mode 100644
337 index 00000000..1a7fad5
338 --- /dev/null
339 +++ b/dev-python/python-systemd/python-systemd-232.ebuild
340 @@ -0,0 +1,42 @@
341 +# Copyright 1999-2016 Gentoo Foundation
342 +# Distributed under the terms of the GNU General Public License v2
343 +# $Id$
344 +
345 +EAPI=6
346 +PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} )
347 +
348 +inherit distutils-r1
349 +
350 +DESCRIPTION="Python module for native access to the systemd facilities"
351 +HOMEPAGE="https://github.com/systemd/python-systemd"
352 +SRC_URI="https://github.com/systemd/python-systemd/archive/v${PV}.tar.gz -> ${P}.tar.gz"
353 +
354 +LICENSE="LGPL-2.1"
355 +SLOT="0"
356 +KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86"
357 +IUSE="test"
358 +
359 +COMMON_DEPEND="
360 + sys-apps/systemd:0=
361 +"
362 +DEPEND="${COMMON_DEPEND}
363 + test? ( dev-python/pytest[${PYTHON_USEDEP}] )
364 +"
365 +RDEPEND="${COMMON_DEPEND}
366 + !sys-apps/systemd[python(-)]
367 +"
368 +
369 +PATCHES=(
370 + "${FILESDIR}"/232-0001-tests-skip-fdstore-tests-if-not-implemented.patch
371 + "${FILESDIR}"/232-0002-docs-fix-sphinx-format-warning.patch
372 + "${FILESDIR}"/232-0003-build-sys-add-doc-sync-target.patch
373 + "${FILESDIR}"/232-0004-tests-add-workaround-for-pre-232-system-returning-EI.patch
374 + "${FILESDIR}"/232-0005-_reader-use-proper-ifdef-guard-for-sd_j_open_files_f.patch
375 + "${FILESDIR}"/232-0006-build-sys-import-pytest-instead-of-py.test.patch
376 +)
377 +
378 +python_test() {
379 + pushd "${BUILD_DIR}/lib" > /dev/null || die
380 + "${PYTHON}" -m pytest -v . || die
381 + popd > /dev/null || die
382 +}