public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/python-systemd/files/, dev-python/python-systemd/
@ 2016-09-24 14:11 Mike Gilbert
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Gilbert @ 2016-09-24 14:11 UTC (permalink / raw
  To: gentoo-commits

commit:     7d1d316ce9552c6388a91e98a817aa2b522a615d
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 24 14:08:06 2016 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sat Sep 24 14:11:33 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d1d316c

dev-python/python-systemd: bump to 232

Package-Manager: portage-2.3.1_p4

 dev-python/python-systemd/Manifest                 |  1 +
 ...sts-skip-fdstore-tests-if-not-implemented.patch | 63 ++++++++++++++++++++++
 .../232-0002-docs-fix-sphinx-format-warning.patch  | 30 +++++++++++
 .../232-0003-build-sys-add-doc-sync-target.patch   | 29 ++++++++++
 ...orkaround-for-pre-232-system-returning-EI.patch | 58 ++++++++++++++++++++
 ...-proper-ifdef-guard-for-sd_j_open_files_f.patch | 55 +++++++++++++++++++
 ...uild-sys-import-pytest-instead-of-py.test.patch | 27 ++++++++++
 .../python-systemd/python-systemd-232.ebuild       | 42 +++++++++++++++
 8 files changed, 305 insertions(+)

diff --git a/dev-python/python-systemd/Manifest b/dev-python/python-systemd/Manifest
index 57c069e..b1907d1 100644
--- a/dev-python/python-systemd/Manifest
+++ b/dev-python/python-systemd/Manifest
@@ -1,2 +1,3 @@
 DIST python-systemd-230.tar.gz 39329 SHA256 656a83ff695f5de7d63411a86ea38601ad5a918595eebd0817d7b8e68642c64d SHA512 3c26c59b9005a45c3aeea8a6838ece9b5aa27dd7394ebe75319c1536b52462a847f18a79fdc8cf3bf6df9a70af63c84d5ff66a9587519dd9a006cc3df4966ce8 WHIRLPOOL 0de7ff6919bdf1c6c9cdafd71944801396157281fae1583bb060da4cf800369f97bb0c9f484f81635ed8b2e170db2bbbecf59adac0470a910167333f93c607e6
 DIST python-systemd-231.tar.gz 44430 SHA256 2c9cf53d041374898beead0c6f3b042c7d5b52425e6eb4d4b3c583d7eac12eea SHA512 b1567bd8e99025cc3b5aaeaab6539af8a5307068c403c0f1628bebc518ded80d0843b804244d1f252c858229f7f9578ce9aa988ded25f55999b0d355ce8a3455 WHIRLPOOL 4a1e05687080e8613ae607f837f39672727e60fc7bca1bca445f46413ce16280ab3bfaa30e969414d0da41f06420b7ef59043d2624dc50342cbe2d6df6add449
+DIST python-systemd-232.tar.gz 49211 SHA256 fc904704faa3dc2888a7336f1c660329c152fd4afb583267ef5d63c4a7f663a1 SHA512 3dfe8a17cd52fdcfce519ff1a64989ba153107d64839c95f93d8266239ed57d0d3510616726a1ab14dfa1b6df8216dc1d8e337d6240d1350378ec58148336325 WHIRLPOOL 34d2d0d1e11575b7fd6497f0543265542bbf7d68dd5a1a3e1c036e5a2518709254d04ee73794d72cb4c51d8f769079cede702fe61d1db7baa4993c213b8e9c2d

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
new file mode 100644
index 00000000..ab8affd
--- /dev/null
+++ b/dev-python/python-systemd/files/232-0001-tests-skip-fdstore-tests-if-not-implemented.patch
@@ -0,0 +1,63 @@
+From 177ac6d894e362b0d22a2765db280abed71cc07f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
+Date: Thu, 22 Sep 2016 07:46:59 -0400
+Subject: [PATCH 1/6] tests: skip fdstore tests if not implemented
+
+Should fix #12.
+---
+ systemd/test/test_daemon.py | 18 +++++++++++++++---
+ 1 file changed, 15 insertions(+), 3 deletions(-)
+
+diff --git a/systemd/test/test_daemon.py b/systemd/test/test_daemon.py
+index 215f1f8..e827e1d 100644
+--- a/systemd/test/test_daemon.py
++++ b/systemd/test/test_daemon.py
+@@ -16,6 +16,15 @@ from systemd.daemon import (booted,
+ import pytest
+ 
+ @contextlib.contextmanager
++def skip_enosys():
++    try:
++        yield
++    except OSError as e:
++        if e.errno == errno.ENOSYS:
++            pytest.skip()
++        raise
++
++@contextlib.contextmanager
+ def closing_socketpair(family):
+     pair = socket.socketpair(family)
+     try:
+@@ -200,7 +209,8 @@ def test_listen_fds_default_unset():
+ 
+ def test_notify_no_socket():
+     assert notify('READY=1') == False
+-    assert notify('FDSTORE=1', fds=[]) == False
++    with skip_enosys():
++        assert notify('FDSTORE=1', fds=[]) == False
+     assert notify('FDSTORE=1', fds=[1,2]) == False
+     assert notify('FDSTORE=1', pid=os.getpid()) == False
+     assert notify('FDSTORE=1', pid=os.getpid(), fds=(1,)) == False
+@@ -216,7 +226,8 @@ def test_notify_bad_socket():
+     with pytest.raises(connection_error):
+         notify('READY=1')
+     with pytest.raises(connection_error):
+-        notify('FDSTORE=1', fds=[])
++        with skip_enosys():
++            notify('FDSTORE=1', fds=[])
+     with pytest.raises(connection_error):
+         notify('FDSTORE=1', fds=[1,2])
+     with pytest.raises(connection_error):
+@@ -234,7 +245,8 @@ def test_notify_with_socket(tmpdir):
+     os.environ['NOTIFY_SOCKET'] = path
+ 
+     assert notify('READY=1') == True
+-    assert notify('FDSTORE=1', fds=[]) == True
++    with skip_enosys():
++        assert notify('FDSTORE=1', fds=[]) == True
+     assert notify('FDSTORE=1', fds=[1,2]) == True
+     assert notify('FDSTORE=1', pid=os.getpid()) == True
+     assert notify('FDSTORE=1', pid=os.getpid(), fds=(1,)) == True
+-- 
+2.10.0
+

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
new file mode 100644
index 00000000..d7fa5f3
--- /dev/null
+++ b/dev-python/python-systemd/files/232-0002-docs-fix-sphinx-format-warning.patch
@@ -0,0 +1,30 @@
+From b9767792b97fe56b37bb59ee3d207ae359f1651c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
+Date: Thu, 22 Sep 2016 09:52:58 -0400
+Subject: [PATCH 2/6] docs: fix sphinx format warning
+
+build/lib.linux-x86_64-3.5/systemd/journal.py:docstring of systemd.journal.stream:15: WARNING: Literal block expected; none found.
+---
+ systemd/journal.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/systemd/journal.py b/systemd/journal.py
+index e930164..a74d62f 100644
+--- a/systemd/journal.py
++++ b/systemd/journal.py
+@@ -461,9 +461,9 @@ def stream(identifier, priority=LOG_DEBUG, level_prefix=False):
+ 
+     will produce the following message in the journal::
+ 
+-    PRIORITY=7
+-    SYSLOG_IDENTIFIER=myapp
+-    MESSAGE=message...
++      PRIORITY=7
++      SYSLOG_IDENTIFIER=myapp
++      MESSAGE=message...
+ 
+     Using the interface with print might be more convenient:
+ 
+-- 
+2.10.0
+

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
new file mode 100644
index 00000000..08b4b29
--- /dev/null
+++ b/dev-python/python-systemd/files/232-0003-build-sys-add-doc-sync-target.patch
@@ -0,0 +1,29 @@
+From c3c412f90e481b88ca897e8542ced207c445c757 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
+Date: Thu, 22 Sep 2016 09:59:04 -0400
+Subject: [PATCH 3/6] build-sys: add doc-sync target
+
+---
+ Makefile | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index df0555c..23b452e 100644
+--- a/Makefile
++++ b/Makefile
+@@ -53,7 +53,11 @@ sphinx-%: build
+ check: build
+ 	(cd $(builddir) && $(PYTHON) -m py.test . ../../docs $(TESTFLAGS))
+ 
++www_target = www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd/python-systemd
++doc-sync:
++	rsync -rlv --delete --omit-dir-times build/html/ $(www_target)/
++
+ TAGS: $(shell git ls-files systemd/*.[ch])
+ 	$(ETAGS) $+
+ 
+-.PHONY: build install dist clean distclean TAGS
++.PHONY: build install dist clean distclean TAGS doc-sync
+-- 
+2.10.0
+

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
new file mode 100644
index 00000000..fd43b46
--- /dev/null
+++ b/dev-python/python-systemd/files/232-0004-tests-add-workaround-for-pre-232-system-returning-EI.patch
@@ -0,0 +1,58 @@
+From 35a5b281adea321ea3f7b7d688a994e735366fb0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
+Date: Thu, 22 Sep 2016 20:12:15 -0400
+Subject: [PATCH 4/6] tests: add workaround for pre-232 system returning EINVAL
+ on some flags
+
+---
+ systemd/test/test_journal.py | 20 +++++++++++++++-----
+ 1 file changed, 15 insertions(+), 5 deletions(-)
+
+diff --git a/systemd/test/test_journal.py b/systemd/test/test_journal.py
+index 0902183..dceec3f 100644
+--- a/systemd/test/test_journal.py
++++ b/systemd/test/test_journal.py
+@@ -21,6 +21,13 @@ def skip_enosys():
+             pytest.skip()
+         raise
+ 
++@contextlib.contextmanager
++def skip_valueerror():
++    try:
++        yield
++    except ValueError:
++        pytest.skip()
++
+ def test_priorities():
+     p = journal.JournalHandler.mapPriority
+ 
+@@ -62,10 +69,12 @@ def test_reader_init_flags():
+ def test_reader_os_root(tmpdir):
+     with pytest.raises(ValueError):
+         journal.Reader(journal.OS_ROOT)
+-    j1 = journal.Reader(path=tmpdir.strpath,
+-                        flags=journal.OS_ROOT)
+-    j2 = journal.Reader(path=tmpdir.strpath,
+-                        flags=journal.OS_ROOT | journal.CURRENT_USER)
++    with skip_valueerror():
++        j1 = journal.Reader(path=tmpdir.strpath,
++                            flags=journal.OS_ROOT)
++    with skip_valueerror():
++        j2 = journal.Reader(path=tmpdir.strpath,
++                            flags=journal.OS_ROOT | journal.CURRENT_USER)
+     j3 = journal.Reader(path=tmpdir.strpath,
+                         flags=journal.OS_ROOT | journal.SYSTEM_ONLY)
+ 
+@@ -91,7 +100,8 @@ def test_reader_init_path_fd(tmpdir):
+         j1 = journal.Reader(path=fd)
+     assert list(j1) == []
+ 
+-    j2 = journal.Reader(journal.SYSTEM, path=fd)
++    with skip_valueerror():
++        j2 = journal.Reader(journal.SYSTEM, path=fd)
+     assert list(j2) == []
+ 
+     j3 = journal.Reader(journal.CURRENT_USER, path=fd)
+-- 
+2.10.0
+

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
new file mode 100644
index 00000000..b751f2d
--- /dev/null
+++ b/dev-python/python-systemd/files/232-0005-_reader-use-proper-ifdef-guard-for-sd_j_open_files_f.patch
@@ -0,0 +1,55 @@
+From 8024fc61719d15b47ace1973b6b901881e17ff2f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
+Date: Thu, 22 Sep 2016 20:41:21 -0400
+Subject: [PATCH 5/6] _reader: use proper ifdef guard for sd_j_open_files_fd
+
+---
+ systemd/_reader.c | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/systemd/_reader.c b/systemd/_reader.c
+index 0f6fd3f..3a2c218 100644
+--- a/systemd/_reader.c
++++ b/systemd/_reader.c
+@@ -283,7 +283,6 @@ static int Reader_init(Reader *self, PyObject *args, PyObject *keywds) {
+                         Py_END_ALLOW_THREADS
+                 }
+         } else if (_files) {
+-#ifdef HAVE_JOURNAL_OPEN_FILES
+                 _cleanup_Py_DECREF_ PyObject *item0 = NULL;
+ 
+                 item0 = PySequence_GetItem(_files, 0);
+@@ -293,9 +292,13 @@ static int Reader_init(Reader *self, PyObject *args, PyObject *keywds) {
+                         if (!strv_converter(_files, &files))
+                                 return -1;
+ 
++#ifdef HAVE_JOURNAL_OPEN_FILES
+                         Py_BEGIN_ALLOW_THREADS
+                         r = sd_journal_open_files(&self->j, (const char**) files, flags);
+                         Py_END_ALLOW_THREADS
++#else
++                        r = -ENOSYS;
++#endif
+                 } else {
+                         _cleanup_free_ int *fds = NULL;
+                         size_t n_fds;
+@@ -303,13 +306,14 @@ static int Reader_init(Reader *self, PyObject *args, PyObject *keywds) {
+                         if (!intlist_converter(_files, &fds, &n_fds))
+                                 return -1;
+ 
++#ifdef HAVE_JOURNAL_OPEN_DIRECTORY_FD
+                         Py_BEGIN_ALLOW_THREADS
+                         r = sd_journal_open_files_fd(&self->j, fds, n_fds, flags);
+                         Py_END_ALLOW_THREADS
+-                }
+ #else
+-                r = -ENOSYS;
++                        r = -ENOSYS;
+ #endif
++                }
+         } else {
+                 Py_BEGIN_ALLOW_THREADS
+                 r = sd_journal_open(&self->j, flags);
+-- 
+2.10.0
+

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
new file mode 100644
index 00000000..04509ab
--- /dev/null
+++ b/dev-python/python-systemd/files/232-0006-build-sys-import-pytest-instead-of-py.test.patch
@@ -0,0 +1,27 @@
+From 911591a1188e03942e60f2ab1abf91562904f49e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
+Date: Thu, 22 Sep 2016 20:24:31 -0400
+Subject: [PATCH 6/6] build-sys: import "pytest" instead of "py.test"
+
+Fixes the following error in rawhide:
+/usr/bin/python3: loader for pytest cannot handle py.test
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 23b452e..b10d6d9 100644
+--- a/Makefile
++++ b/Makefile
+@@ -51,7 +51,7 @@ sphinx-%: build
+ 	@echo Output has been generated in build/$*
+ 
+ check: build
+-	(cd $(builddir) && $(PYTHON) -m py.test . ../../docs $(TESTFLAGS))
++	(cd $(builddir) && $(PYTHON) -m pytest . ../../docs $(TESTFLAGS))
+ 
+ www_target = www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd/python-systemd
+ doc-sync:
+-- 
+2.10.0
+

diff --git a/dev-python/python-systemd/python-systemd-232.ebuild b/dev-python/python-systemd/python-systemd-232.ebuild
new file mode 100644
index 00000000..1a7fad5
--- /dev/null
+++ b/dev-python/python-systemd/python-systemd-232.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} )
+
+inherit distutils-r1
+
+DESCRIPTION="Python module for native access to the systemd facilities"
+HOMEPAGE="https://github.com/systemd/python-systemd"
+SRC_URI="https://github.com/systemd/python-systemd/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86"
+IUSE="test"
+
+COMMON_DEPEND="
+	sys-apps/systemd:0=
+"
+DEPEND="${COMMON_DEPEND}
+	test? ( dev-python/pytest[${PYTHON_USEDEP}] )
+"
+RDEPEND="${COMMON_DEPEND}
+	!sys-apps/systemd[python(-)]
+"
+
+PATCHES=(
+	"${FILESDIR}"/232-0001-tests-skip-fdstore-tests-if-not-implemented.patch
+	"${FILESDIR}"/232-0002-docs-fix-sphinx-format-warning.patch
+	"${FILESDIR}"/232-0003-build-sys-add-doc-sync-target.patch
+	"${FILESDIR}"/232-0004-tests-add-workaround-for-pre-232-system-returning-EI.patch
+	"${FILESDIR}"/232-0005-_reader-use-proper-ifdef-guard-for-sd_j_open_files_f.patch
+	"${FILESDIR}"/232-0006-build-sys-import-pytest-instead-of-py.test.patch
+)
+
+python_test() {
+	pushd "${BUILD_DIR}/lib" > /dev/null || die
+	"${PYTHON}" -m pytest -v . || die
+	popd > /dev/null || die
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/python-systemd/files/, dev-python/python-systemd/
@ 2016-10-17 15:53 Mike Gilbert
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Gilbert @ 2016-10-17 15:53 UTC (permalink / raw
  To: gentoo-commits

commit:     ac163fe015f6c68e0df72a28bd9ae806cb939dd2
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 17 15:50:31 2016 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Oct 17 15:53:00 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ac163fe0

dev-python/python-systemd: bump to 233

Package-Manager: portage-2.3.2

 dev-python/python-systemd/Manifest                 |  3 +-
 .../files/231-test_daemon-SO_PASSCRED.patch        | 28 ----------
 ...sts-skip-fdstore-tests-if-not-implemented.patch | 63 ----------------------
 .../232-0002-docs-fix-sphinx-format-warning.patch  | 30 -----------
 .../232-0003-build-sys-add-doc-sync-target.patch   | 29 ----------
 ...orkaround-for-pre-232-system-returning-EI.patch | 58 --------------------
 ...-proper-ifdef-guard-for-sd_j_open_files_f.patch | 55 -------------------
 ...uild-sys-import-pytest-instead-of-py.test.patch | 27 ----------
 .../python-systemd/python-systemd-232.ebuild       | 42 ---------------
 ...ystemd-231.ebuild => python-systemd-233.ebuild} | 12 ++---
 10 files changed, 6 insertions(+), 341 deletions(-)

diff --git a/dev-python/python-systemd/Manifest b/dev-python/python-systemd/Manifest
index b1907d1..1413475 100644
--- a/dev-python/python-systemd/Manifest
+++ b/dev-python/python-systemd/Manifest
@@ -1,3 +1,2 @@
 DIST python-systemd-230.tar.gz 39329 SHA256 656a83ff695f5de7d63411a86ea38601ad5a918595eebd0817d7b8e68642c64d SHA512 3c26c59b9005a45c3aeea8a6838ece9b5aa27dd7394ebe75319c1536b52462a847f18a79fdc8cf3bf6df9a70af63c84d5ff66a9587519dd9a006cc3df4966ce8 WHIRLPOOL 0de7ff6919bdf1c6c9cdafd71944801396157281fae1583bb060da4cf800369f97bb0c9f484f81635ed8b2e170db2bbbecf59adac0470a910167333f93c607e6
-DIST python-systemd-231.tar.gz 44430 SHA256 2c9cf53d041374898beead0c6f3b042c7d5b52425e6eb4d4b3c583d7eac12eea SHA512 b1567bd8e99025cc3b5aaeaab6539af8a5307068c403c0f1628bebc518ded80d0843b804244d1f252c858229f7f9578ce9aa988ded25f55999b0d355ce8a3455 WHIRLPOOL 4a1e05687080e8613ae607f837f39672727e60fc7bca1bca445f46413ce16280ab3bfaa30e969414d0da41f06420b7ef59043d2624dc50342cbe2d6df6add449
-DIST python-systemd-232.tar.gz 49211 SHA256 fc904704faa3dc2888a7336f1c660329c152fd4afb583267ef5d63c4a7f663a1 SHA512 3dfe8a17cd52fdcfce519ff1a64989ba153107d64839c95f93d8266239ed57d0d3510616726a1ab14dfa1b6df8216dc1d8e337d6240d1350378ec58148336325 WHIRLPOOL 34d2d0d1e11575b7fd6497f0543265542bbf7d68dd5a1a3e1c036e5a2518709254d04ee73794d72cb4c51d8f769079cede702fe61d1db7baa4993c213b8e9c2d
+DIST python-systemd-233.tar.gz 49680 SHA256 efb5c440d7ca05ce1fce48c14508177c0002663ea933e16eaf88105f1ad8dfe7 SHA512 92a6cc7123db586e5ae5fbb56e5065b17be9da47ced9dbc5920d80b7db7f56d15b127e72d30889c5b24b119724a33f68be1ef322529620ed95b0f95707e4c2ab WHIRLPOOL a564098a7362fa48b50ac5a28111746d3a35a6602bf313d04f0e5c63078b8c0e2c84e7e648c572dd09ac13122a709bb4f6d9eb2548e08f75a367bd363a594fb1

diff --git a/dev-python/python-systemd/files/231-test_daemon-SO_PASSCRED.patch b/dev-python/python-systemd/files/231-test_daemon-SO_PASSCRED.patch
deleted file mode 100644
index d62f34e..00000000
--- a/dev-python/python-systemd/files/231-test_daemon-SO_PASSCRED.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From a129428dcd92095dc5f3c7ac4b4f096181129063 Mon Sep 17 00:00:00 2001
-From: Mike Gilbert <floppym@gentoo.org>
-Date: Sat, 19 Dec 2015 09:42:49 -0500
-Subject: [PATCH] test_daemon: Define a default value for SO_PASSCRED
-
-The socket module seems to be missing this in python2.7.
----
- systemd/test/test_daemon.py | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/systemd/test/test_daemon.py b/systemd/test/test_daemon.py
-index e055048..8c776d5 100644
---- a/systemd/test/test_daemon.py
-+++ b/systemd/test/test_daemon.py
-@@ -228,7 +228,9 @@ def test_notify_with_socket(tmpdir):
-     path = tmpdir.join('socket').strpath
-     sock = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
-     sock.bind(path)
--    sock.setsockopt(socket.SOL_SOCKET, socket.SO_PASSCRED, 1)
-+    # SO_PASSCRED is not defined in python2.7
-+    SO_PASSCRED = getattr(socket, 'SO_PASSCRED', 16)
-+    sock.setsockopt(socket.SOL_SOCKET, SO_PASSCRED, 1)
-     os.environ['NOTIFY_SOCKET'] = path
- 
-     assert notify('READY=1') == True
--- 
-2.6.4
-

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
deleted file mode 100644
index ab8affd..00000000
--- a/dev-python/python-systemd/files/232-0001-tests-skip-fdstore-tests-if-not-implemented.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From 177ac6d894e362b0d22a2765db280abed71cc07f Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
-Date: Thu, 22 Sep 2016 07:46:59 -0400
-Subject: [PATCH 1/6] tests: skip fdstore tests if not implemented
-
-Should fix #12.
----
- systemd/test/test_daemon.py | 18 +++++++++++++++---
- 1 file changed, 15 insertions(+), 3 deletions(-)
-
-diff --git a/systemd/test/test_daemon.py b/systemd/test/test_daemon.py
-index 215f1f8..e827e1d 100644
---- a/systemd/test/test_daemon.py
-+++ b/systemd/test/test_daemon.py
-@@ -16,6 +16,15 @@ from systemd.daemon import (booted,
- import pytest
- 
- @contextlib.contextmanager
-+def skip_enosys():
-+    try:
-+        yield
-+    except OSError as e:
-+        if e.errno == errno.ENOSYS:
-+            pytest.skip()
-+        raise
-+
-+@contextlib.contextmanager
- def closing_socketpair(family):
-     pair = socket.socketpair(family)
-     try:
-@@ -200,7 +209,8 @@ def test_listen_fds_default_unset():
- 
- def test_notify_no_socket():
-     assert notify('READY=1') == False
--    assert notify('FDSTORE=1', fds=[]) == False
-+    with skip_enosys():
-+        assert notify('FDSTORE=1', fds=[]) == False
-     assert notify('FDSTORE=1', fds=[1,2]) == False
-     assert notify('FDSTORE=1', pid=os.getpid()) == False
-     assert notify('FDSTORE=1', pid=os.getpid(), fds=(1,)) == False
-@@ -216,7 +226,8 @@ def test_notify_bad_socket():
-     with pytest.raises(connection_error):
-         notify('READY=1')
-     with pytest.raises(connection_error):
--        notify('FDSTORE=1', fds=[])
-+        with skip_enosys():
-+            notify('FDSTORE=1', fds=[])
-     with pytest.raises(connection_error):
-         notify('FDSTORE=1', fds=[1,2])
-     with pytest.raises(connection_error):
-@@ -234,7 +245,8 @@ def test_notify_with_socket(tmpdir):
-     os.environ['NOTIFY_SOCKET'] = path
- 
-     assert notify('READY=1') == True
--    assert notify('FDSTORE=1', fds=[]) == True
-+    with skip_enosys():
-+        assert notify('FDSTORE=1', fds=[]) == True
-     assert notify('FDSTORE=1', fds=[1,2]) == True
-     assert notify('FDSTORE=1', pid=os.getpid()) == True
-     assert notify('FDSTORE=1', pid=os.getpid(), fds=(1,)) == True
--- 
-2.10.0
-

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
deleted file mode 100644
index d7fa5f3..00000000
--- a/dev-python/python-systemd/files/232-0002-docs-fix-sphinx-format-warning.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From b9767792b97fe56b37bb59ee3d207ae359f1651c Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
-Date: Thu, 22 Sep 2016 09:52:58 -0400
-Subject: [PATCH 2/6] docs: fix sphinx format warning
-
-build/lib.linux-x86_64-3.5/systemd/journal.py:docstring of systemd.journal.stream:15: WARNING: Literal block expected; none found.
----
- systemd/journal.py | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/systemd/journal.py b/systemd/journal.py
-index e930164..a74d62f 100644
---- a/systemd/journal.py
-+++ b/systemd/journal.py
-@@ -461,9 +461,9 @@ def stream(identifier, priority=LOG_DEBUG, level_prefix=False):
- 
-     will produce the following message in the journal::
- 
--    PRIORITY=7
--    SYSLOG_IDENTIFIER=myapp
--    MESSAGE=message...
-+      PRIORITY=7
-+      SYSLOG_IDENTIFIER=myapp
-+      MESSAGE=message...
- 
-     Using the interface with print might be more convenient:
- 
--- 
-2.10.0
-

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
deleted file mode 100644
index 08b4b29..00000000
--- a/dev-python/python-systemd/files/232-0003-build-sys-add-doc-sync-target.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From c3c412f90e481b88ca897e8542ced207c445c757 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
-Date: Thu, 22 Sep 2016 09:59:04 -0400
-Subject: [PATCH 3/6] build-sys: add doc-sync target
-
----
- Makefile | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/Makefile b/Makefile
-index df0555c..23b452e 100644
---- a/Makefile
-+++ b/Makefile
-@@ -53,7 +53,11 @@ sphinx-%: build
- check: build
- 	(cd $(builddir) && $(PYTHON) -m py.test . ../../docs $(TESTFLAGS))
- 
-+www_target = www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd/python-systemd
-+doc-sync:
-+	rsync -rlv --delete --omit-dir-times build/html/ $(www_target)/
-+
- TAGS: $(shell git ls-files systemd/*.[ch])
- 	$(ETAGS) $+
- 
--.PHONY: build install dist clean distclean TAGS
-+.PHONY: build install dist clean distclean TAGS doc-sync
--- 
-2.10.0
-

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
deleted file mode 100644
index fd43b46..00000000
--- a/dev-python/python-systemd/files/232-0004-tests-add-workaround-for-pre-232-system-returning-EI.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From 35a5b281adea321ea3f7b7d688a994e735366fb0 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
-Date: Thu, 22 Sep 2016 20:12:15 -0400
-Subject: [PATCH 4/6] tests: add workaround for pre-232 system returning EINVAL
- on some flags
-
----
- systemd/test/test_journal.py | 20 +++++++++++++++-----
- 1 file changed, 15 insertions(+), 5 deletions(-)
-
-diff --git a/systemd/test/test_journal.py b/systemd/test/test_journal.py
-index 0902183..dceec3f 100644
---- a/systemd/test/test_journal.py
-+++ b/systemd/test/test_journal.py
-@@ -21,6 +21,13 @@ def skip_enosys():
-             pytest.skip()
-         raise
- 
-+@contextlib.contextmanager
-+def skip_valueerror():
-+    try:
-+        yield
-+    except ValueError:
-+        pytest.skip()
-+
- def test_priorities():
-     p = journal.JournalHandler.mapPriority
- 
-@@ -62,10 +69,12 @@ def test_reader_init_flags():
- def test_reader_os_root(tmpdir):
-     with pytest.raises(ValueError):
-         journal.Reader(journal.OS_ROOT)
--    j1 = journal.Reader(path=tmpdir.strpath,
--                        flags=journal.OS_ROOT)
--    j2 = journal.Reader(path=tmpdir.strpath,
--                        flags=journal.OS_ROOT | journal.CURRENT_USER)
-+    with skip_valueerror():
-+        j1 = journal.Reader(path=tmpdir.strpath,
-+                            flags=journal.OS_ROOT)
-+    with skip_valueerror():
-+        j2 = journal.Reader(path=tmpdir.strpath,
-+                            flags=journal.OS_ROOT | journal.CURRENT_USER)
-     j3 = journal.Reader(path=tmpdir.strpath,
-                         flags=journal.OS_ROOT | journal.SYSTEM_ONLY)
- 
-@@ -91,7 +100,8 @@ def test_reader_init_path_fd(tmpdir):
-         j1 = journal.Reader(path=fd)
-     assert list(j1) == []
- 
--    j2 = journal.Reader(journal.SYSTEM, path=fd)
-+    with skip_valueerror():
-+        j2 = journal.Reader(journal.SYSTEM, path=fd)
-     assert list(j2) == []
- 
-     j3 = journal.Reader(journal.CURRENT_USER, path=fd)
--- 
-2.10.0
-

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
deleted file mode 100644
index b751f2d..00000000
--- a/dev-python/python-systemd/files/232-0005-_reader-use-proper-ifdef-guard-for-sd_j_open_files_f.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 8024fc61719d15b47ace1973b6b901881e17ff2f Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
-Date: Thu, 22 Sep 2016 20:41:21 -0400
-Subject: [PATCH 5/6] _reader: use proper ifdef guard for sd_j_open_files_fd
-
----
- systemd/_reader.c | 10 +++++++---
- 1 file changed, 7 insertions(+), 3 deletions(-)
-
-diff --git a/systemd/_reader.c b/systemd/_reader.c
-index 0f6fd3f..3a2c218 100644
---- a/systemd/_reader.c
-+++ b/systemd/_reader.c
-@@ -283,7 +283,6 @@ static int Reader_init(Reader *self, PyObject *args, PyObject *keywds) {
-                         Py_END_ALLOW_THREADS
-                 }
-         } else if (_files) {
--#ifdef HAVE_JOURNAL_OPEN_FILES
-                 _cleanup_Py_DECREF_ PyObject *item0 = NULL;
- 
-                 item0 = PySequence_GetItem(_files, 0);
-@@ -293,9 +292,13 @@ static int Reader_init(Reader *self, PyObject *args, PyObject *keywds) {
-                         if (!strv_converter(_files, &files))
-                                 return -1;
- 
-+#ifdef HAVE_JOURNAL_OPEN_FILES
-                         Py_BEGIN_ALLOW_THREADS
-                         r = sd_journal_open_files(&self->j, (const char**) files, flags);
-                         Py_END_ALLOW_THREADS
-+#else
-+                        r = -ENOSYS;
-+#endif
-                 } else {
-                         _cleanup_free_ int *fds = NULL;
-                         size_t n_fds;
-@@ -303,13 +306,14 @@ static int Reader_init(Reader *self, PyObject *args, PyObject *keywds) {
-                         if (!intlist_converter(_files, &fds, &n_fds))
-                                 return -1;
- 
-+#ifdef HAVE_JOURNAL_OPEN_DIRECTORY_FD
-                         Py_BEGIN_ALLOW_THREADS
-                         r = sd_journal_open_files_fd(&self->j, fds, n_fds, flags);
-                         Py_END_ALLOW_THREADS
--                }
- #else
--                r = -ENOSYS;
-+                        r = -ENOSYS;
- #endif
-+                }
-         } else {
-                 Py_BEGIN_ALLOW_THREADS
-                 r = sd_journal_open(&self->j, flags);
--- 
-2.10.0
-

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
deleted file mode 100644
index 04509ab..00000000
--- a/dev-python/python-systemd/files/232-0006-build-sys-import-pytest-instead-of-py.test.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 911591a1188e03942e60f2ab1abf91562904f49e Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
-Date: Thu, 22 Sep 2016 20:24:31 -0400
-Subject: [PATCH 6/6] build-sys: import "pytest" instead of "py.test"
-
-Fixes the following error in rawhide:
-/usr/bin/python3: loader for pytest cannot handle py.test
----
- Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Makefile b/Makefile
-index 23b452e..b10d6d9 100644
---- a/Makefile
-+++ b/Makefile
-@@ -51,7 +51,7 @@ sphinx-%: build
- 	@echo Output has been generated in build/$*
- 
- check: build
--	(cd $(builddir) && $(PYTHON) -m py.test . ../../docs $(TESTFLAGS))
-+	(cd $(builddir) && $(PYTHON) -m pytest . ../../docs $(TESTFLAGS))
- 
- www_target = www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd/python-systemd
- doc-sync:
--- 
-2.10.0
-

diff --git a/dev-python/python-systemd/python-systemd-232.ebuild b/dev-python/python-systemd/python-systemd-232.ebuild
deleted file mode 100644
index 1a7fad5..00000000
--- a/dev-python/python-systemd/python-systemd-232.ebuild
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=6
-PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} )
-
-inherit distutils-r1
-
-DESCRIPTION="Python module for native access to the systemd facilities"
-HOMEPAGE="https://github.com/systemd/python-systemd"
-SRC_URI="https://github.com/systemd/python-systemd/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="LGPL-2.1"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86"
-IUSE="test"
-
-COMMON_DEPEND="
-	sys-apps/systemd:0=
-"
-DEPEND="${COMMON_DEPEND}
-	test? ( dev-python/pytest[${PYTHON_USEDEP}] )
-"
-RDEPEND="${COMMON_DEPEND}
-	!sys-apps/systemd[python(-)]
-"
-
-PATCHES=(
-	"${FILESDIR}"/232-0001-tests-skip-fdstore-tests-if-not-implemented.patch
-	"${FILESDIR}"/232-0002-docs-fix-sphinx-format-warning.patch
-	"${FILESDIR}"/232-0003-build-sys-add-doc-sync-target.patch
-	"${FILESDIR}"/232-0004-tests-add-workaround-for-pre-232-system-returning-EI.patch
-	"${FILESDIR}"/232-0005-_reader-use-proper-ifdef-guard-for-sd_j_open_files_f.patch
-	"${FILESDIR}"/232-0006-build-sys-import-pytest-instead-of-py.test.patch
-)
-
-python_test() {
-	pushd "${BUILD_DIR}/lib" > /dev/null || die
-	"${PYTHON}" -m pytest -v . || die
-	popd > /dev/null || die
-}

diff --git a/dev-python/python-systemd/python-systemd-231.ebuild b/dev-python/python-systemd/python-systemd-233.ebuild
similarity index 80%
rename from dev-python/python-systemd/python-systemd-231.ebuild
rename to dev-python/python-systemd/python-systemd-233.ebuild
index e9f49c8..b0f7ccf 100644
--- a/dev-python/python-systemd/python-systemd-231.ebuild
+++ b/dev-python/python-systemd/python-systemd-233.ebuild
@@ -1,8 +1,8 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-EAPI=5
+EAPI=6
 PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} )
 
 inherit distutils-r1
@@ -26,10 +26,8 @@ RDEPEND="${COMMON_DEPEND}
 	!sys-apps/systemd[python(-)]
 "
 
-PATCHES=(
-	"${FILESDIR}"/231-test_daemon-SO_PASSCRED.patch
-)
-
 python_test() {
-	py.test "${BUILD_DIR}/lib" || die
+	pushd "${BUILD_DIR}/lib" > /dev/null || die
+	"${EPYTHON}" -m pytest -v . || die
+	popd > /dev/null || die
 }


^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/python-systemd/files/, dev-python/python-systemd/
@ 2017-02-21 23:59 Mike Gilbert
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Gilbert @ 2017-02-21 23:59 UTC (permalink / raw
  To: gentoo-commits

commit:     ba81c88850a194ddccc120cc2f936e2bdbac24a8
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 21 23:58:44 2017 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Tue Feb 21 23:59:16 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba81c888

dev-python/python-systemd: xfail test_notify_with_socket if bind() fails

Bug: https://bugs.gentoo.org/610368
Package-Manager: Portage-2.3.3_p56, Repoman-2.3.1_p49

 .../python-systemd/files/233-xfail-bind.patch      | 31 ++++++++++++++++++++++
 .../python-systemd/python-systemd-233.ebuild       |  6 ++++-
 2 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/dev-python/python-systemd/files/233-xfail-bind.patch b/dev-python/python-systemd/files/233-xfail-bind.patch
new file mode 100644
index 0000000000..bb0fb761bd
--- /dev/null
+++ b/dev-python/python-systemd/files/233-xfail-bind.patch
@@ -0,0 +1,31 @@
+From 1c0d575f7c058f227d27b1cb92d3936d0c170a5f Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Tue, 21 Feb 2017 17:34:28 -0500
+Subject: [PATCH] test_daemon: xfail test_notify_with_socket if bind() fails
+
+This bind() call may fail if TMPDIR is too long.
+
+Bug: https://bugs.gentoo.org/610368
+---
+ systemd/test/test_daemon.py | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/systemd/test/test_daemon.py b/systemd/test/test_daemon.py
+index e827e1d..7733552 100644
+--- a/systemd/test/test_daemon.py
++++ b/systemd/test/test_daemon.py
+@@ -238,7 +238,10 @@ def test_notify_bad_socket():
+ def test_notify_with_socket(tmpdir):
+     path = tmpdir.join('socket').strpath
+     sock = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
+-    sock.bind(path)
++    try:
++        sock.bind(path)
++    except socket.error as e:
++        pytest.xfail('failed to bind socket (%s)' % e)
+     # SO_PASSCRED is not defined in python2.7
+     SO_PASSCRED = getattr(socket, 'SO_PASSCRED', 16)
+     sock.setsockopt(socket.SOL_SOCKET, SO_PASSCRED, 1)
+-- 
+2.11.1
+

diff --git a/dev-python/python-systemd/python-systemd-233.ebuild b/dev-python/python-systemd/python-systemd-233.ebuild
index fbca17a286..3550384d77 100644
--- a/dev-python/python-systemd/python-systemd-233.ebuild
+++ b/dev-python/python-systemd/python-systemd-233.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -26,6 +26,10 @@ RDEPEND="${COMMON_DEPEND}
 	!sys-apps/systemd[python(-)]
 "
 
+PATCHES=(
+	"${FILESDIR}"/233-xfail-bind.patch
+)
+
 python_test() {
 	pushd "${BUILD_DIR}/lib" > /dev/null || die
 	"${EPYTHON}" -m pytest -v . || die


^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/python-systemd/files/, dev-python/python-systemd/
@ 2021-12-17 17:58 Arthur Zamarin
  0 siblings, 0 replies; 4+ messages in thread
From: Arthur Zamarin @ 2021-12-17 17:58 UTC (permalink / raw
  To: gentoo-commits

commit:     9d7601b1e4f7e1916f12a3eb9a48853216570f7f
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 17 17:54:43 2021 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri Dec 17 17:58:32 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9d7601b1

dev-python/python-systemd: enable py3.10

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 .../files/python-systemd-234-fix-py3.10.patch      | 46 ++++++++++++++++++++++
 .../python-systemd/python-systemd-234-r1.ebuild    | 39 ++++++++++++++++++
 2 files changed, 85 insertions(+)

diff --git a/dev-python/python-systemd/files/python-systemd-234-fix-py3.10.patch b/dev-python/python-systemd/files/python-systemd-234-fix-py3.10.patch
new file mode 100644
index 000000000000..52045b4475e1
--- /dev/null
+++ b/dev-python/python-systemd/files/python-systemd-234-fix-py3.10.patch
@@ -0,0 +1,46 @@
+From c71bbac357f0ac722e1bcb2edfa925b68cca23c9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
+Date: Thu, 12 Nov 2020 16:55:56 +0100
+Subject: [PATCH] reader: make PY_SSIZE_T_CLEAN
+
+---
+ systemd/_reader.c | 15 +++++++++++++--
+ 1 file changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/systemd/_reader.c b/systemd/_reader.c
+index 8de7f6a..3b6a4d0 100644
+--- a/systemd/_reader.c
++++ b/systemd/_reader.c
+@@ -18,7 +18,12 @@
+   along with python-systemd; If not, see <http://www.gnu.org/licenses/>.
+ ***/
+ 
++#define PY_SSIZE_T_CLEAN
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wredundant-decls"
+ #include <Python.h>
++#pragma GCC diagnostic pop
++
+ #include <structmember.h>
+ #include <datetime.h>
+ #include <time.h>
+@@ -710,11 +715,17 @@ PyDoc_STRVAR(Reader_add_match__doc__,
+              "Match is a string of the form \"FIELD=value\".");
+ static PyObject* Reader_add_match(Reader *self, PyObject *args, PyObject *keywds) {
+         char *match;
+-        int match_len, r;
++        Py_ssize_t match_len;
++        int r;
+         if (!PyArg_ParseTuple(args, "s#:add_match", &match, &match_len))
+                 return NULL;
+ 
+-        r = sd_journal_add_match(self->j, match, match_len);
++        if (match_len > INT_MAX) {
++                set_error(-ENOBUFS, NULL, NULL);
++                return NULL;
++        }
++
++        r = sd_journal_add_match(self->j, match, (int) match_len);
+         if (set_error(r, NULL, "Invalid match") < 0)
+                 return NULL;
+ 

diff --git a/dev-python/python-systemd/python-systemd-234-r1.ebuild b/dev-python/python-systemd/python-systemd-234-r1.ebuild
new file mode 100644
index 000000000000..7c9442a28b16
--- /dev/null
+++ b/dev-python/python-systemd/python-systemd-234-r1.ebuild
@@ -0,0 +1,39 @@
+# Copyright 2015-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8..10} )
+DISTUTILS_USE_SETUPTOOLS="no"
+
+inherit distutils-r1
+
+DESCRIPTION="Python module for native access to the systemd facilities"
+HOMEPAGE="https://github.com/systemd/python-systemd"
+SRC_URI="https://github.com/systemd/python-systemd/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
+
+DEPEND="sys-apps/systemd:0="
+RDEPEND="${DEPEND}
+	!sys-apps/systemd[python(-)]
+"
+
+PATCHES=(
+	"${FILESDIR}"/${P}-fix-py3.10.patch
+)
+
+distutils_enable_tests pytest
+
+python_compile() {
+	# https://bugs.gentoo.org/690316
+	distutils-r1_python_compile -j1
+}
+
+python_test() {
+	pushd "${BUILD_DIR}/lib" > /dev/null || die
+	epytest -o cache_dir="${T}"
+	popd > /dev/null || die
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-17 17:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-24 14:11 [gentoo-commits] repo/gentoo:master commit in: dev-python/python-systemd/files/, dev-python/python-systemd/ Mike Gilbert
  -- strict thread matches above, loose matches on Subject: below --
2016-10-17 15:53 Mike Gilbert
2017-02-21 23:59 Mike Gilbert
2021-12-17 17:58 Arthur Zamarin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox