Sync from SUSE:SLFO:Main python-systemd revision ffc9cb63bb000093a6f8640d06f5027c

This commit is contained in:
Adrian Schröter 2024-05-03 23:11:59 +02:00
commit 9912d31b3d
6 changed files with 323 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

View File

@ -0,0 +1,39 @@
From 50d1ec8ab8d3333ef1b7cac982155b94c7534c4c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Wed, 17 Aug 2022 09:53:25 +0200
Subject: [PATCH] tests: check for errnos that sd_id128_get_machine actually
returns
Fixes #118.
---
systemd/test/test_id128.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/systemd/test/test_id128.py b/systemd/test/test_id128.py
index 146ec73..f5fc65f 100644
--- a/systemd/test/test_id128.py
+++ b/systemd/test/test_id128.py
@@ -6,11 +6,11 @@
from systemd import id128
@contextlib.contextmanager
-def skip_oserror(code):
+def skip_oserror(*errnos):
try:
yield
except (OSError, IOError) as e:
- if e.errno == code:
+ if e.errno in errnos:
pytest.skip()
raise
@@ -29,7 +29,8 @@ def test_get_machine_app_specific():
a1 = uuid.uuid1()
a2 = uuid.uuid1()
- with skip_oserror(errno.ENOSYS):
+ # yikes, python2 doesn't know ENOMEDIUM
+ with skip_oserror(errno.ENOENT, 123):
u1 = id128.get_machine_app_specific(a1)
u2 = id128.get_machine_app_specific(a2)

20
iso-c-90.patch Normal file
View File

@ -0,0 +1,20 @@
---
systemd/_daemon.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/systemd/_daemon.c
+++ b/systemd/_daemon.c
@@ -121,11 +121,12 @@ static PyObject* notify(PyObject *self,
return NULL;
for (i = 0; i < len; i++) {
+ long value;
_cleanup_Py_DECREF_ PyObject *item = PySequence_GetItem(fds, i);
if (!item)
return NULL;
- long value = PyLong_AsLong(item);
+ value = PyLong_AsLong(item);
if (PyErr_Occurred())
return NULL;

BIN
python-systemd-235.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

162
python-systemd.changes Normal file
View File

@ -0,0 +1,162 @@
-------------------------------------------------------------------
Sun Jun 11 14:08:18 UTC 2023 - ecsos <ecsos@opensuse.org>
- Add %{?sle15_python_module_pythons}
-------------------------------------------------------------------
Wed Aug 17 09:03:29 UTC 2022 - Matej Cepl <mcepl@suse.com>
- Add OBS_missing_etc_machine_id.patch to partially fix
gh#systemd/python-systemd#118.
-------------------------------------------------------------------
Wed Aug 17 05:49:41 UTC 2022 - Matej Cepl <mcepl@suse.com>
- Update to version 235:
* Adapt the rename of systemd-activate to
systemd-socket-activate performed in systemd 230.
* Support for sd_listen_fds_with_names added in systemd 227.
* Support for sd_journal_get_cutoff_realtime_usec added in
systemd 186.
* Make the Reader PY_SSIZE_T_CLEAN for py3.10 compatibility.
* id128: update for systemd-243 compatibility and other fixes.
* C syntax modernization. A minimum of C99 is assumed.
* Fix seek_realtime to work with timezone aware date on Python 3.
* journal: add namespace support.
* Fixes for memory leaks and documentation.
* Support for Python 2 will be removed after this release.
- Remove upstreamed 0002-reader-make-PY_SSIZE_T_CLEAN.patch.
- Skip two failing tests (gh#systemd/python-systemd#118)
-------------------------------------------------------------------
Sun Jul 3 21:14:35 UTC 2022 - Matej Cepl <mcepl@suse.com>
- Remove exclude-tests-on-obs.patch, this is not the way how to
do it, besides %python_exec setup.py check doesn't the test
suite.
- Make tests running properly again
-------------------------------------------------------------------
Sun Jul 3 18:00:37 UTC 2022 - Arjen de Korte <suse+build@de-korte.org>
- 0002-reader-make-PY_SSIZE_T_CLEAN.patch added to fix boo#1200686
reader: make PY_SSIZE_T_CLEAN
-------------------------------------------------------------------
Sun Feb 2 14:05:14 UTC 2020 - Dominique Leuenberger <dimstar@opensuse.org>
- BuildRequire pkgconfig(libsystemd) instead of systemd-devel:
allow OBS to shortcut through the -mini flavors.
-------------------------------------------------------------------
Tue Nov 14 12:47:02 UTC 2017 - mpluskal@suse.com
- Use more of python building macros
- Do not build documentation (build is broken if /usr/bin/python is
not present anyways)
- Run spec-cleaner
-------------------------------------------------------------------
Mon Nov 6 18:15:19 UTC 2017 - jweberhofer@weberhofer.at
- iso-c-90.patch added to fix building on SLE12-SP3
-------------------------------------------------------------------
Sat Oct 7 13:20:19 UTC 2017 - sebix+novell.com@sebix.at
- singlespec
-------------------------------------------------------------------
Mon Jun 26 09:17:01 UTC 2017 - jweberhofer@weberhofer.at
- exclude-tests-on-obs.patch: Exclude test which fail because of
a bug in the OBS: https://github.com/openSUSE/obs-build/pull/351
- Upgrade to release 234
* _daemon,_reader: return ENOSYS instead of NotImplemented
* _daemon: allow specifying flowinfo
* Added section for installation on openSUSE & SLE
* Adjust import order, spacing, operators as recommended by pylint
* build-sys: add sign and upload targets
* daemon: add basic support for sd_is_socket_sockaddr
* daemon: add wrapper for sd_is_socket_sockaddr and tests
* daemon: properly skip sd_is_socket_sockaddr calls if not available
* Fix handling of addresses without port and add tests
* Fix styling to match PEP8 in most places
* Improve test skipping on old systems
* Include all fields from record
* journal: do not convert extra args to string in JournalHandler
* journal: fix repr of JournalHandler to match python3.6
* journal: improve docstring formatting a bit
* journal: rename SENDER_FUNCTION to sender_function
* Makefile: add "doc" target for convenience
* Makefile: add convenience "shell" target to start python shell
* Makefile: remove unneeded -I/usr/include from flags
* Makefile: use $(INCLUDE_DIR) also for compilation
* Prevent non-str values from being concatenated with +
* Python 3.6 invalid escape sequence deprecation fixes
* Remove mid from JournalHandler
* replace dict.iteritems() with dict.items() to support py3
* setup.py: allow LIBSYSTEMD_VERSION to be overridden
* test_daemon: xfail test_notify_with_socket if bind() fails
* test_journal: add tests for MESSAGE_ID passing
* tests: move login tests from doctest to separate file
* tests: skip journal.stream tests on ENOENT error
* Update to constants from systemd-233
* util: add compatibility for old glibc
-------------------------------------------------------------------
Mon Jun 12 05:34:47 UTC 2017 - fbui@suse.com
- Upgrade to release 233:
+ Tests are fixed and should pass on various old and new systems
alike.
+ journal.stream() can be used without arguments and defaults to
LOG_LEVEL.
- Changes from version 232:
+ Wrappers for sd_journal_enumerate_unique, has_runtime_files,
has_peristent_files.
+ sd_journal_open_directory_fd, sd_journal_open_files_fd can be
used by passing file descriptors to the initializer as the path
or files arguments.
-------------------------------------------------------------------
Mon Jan 2 11:48:12 UTC 2017 - sebix+novell.com@sebix.at
- add doc package
-------------------------------------------------------------------
Sat Oct 31 21:17:21 UTC 2015 - jweberhofer@weberhofer.at
- Upgrade to release 231
* Various build fixes and cleanups: documentation can be generated with 'make
sphinx-html', pip install works out of the box.
* Tests that cover most of the python code were added. As a result, a bug in
sd_is_mq was fixed in systemd 227.
* Functions sd_pid_notify and sd_pid_notify_with_fds are now wrapped as
optional arguments to notify(), when compiled against a new-enough
libsystemd.
- Run tests
- Removed obsolete python-systemd-libraries-for-opensuse-1310.patch patch
- New build dependencies had been added
-------------------------------------------------------------------
Thu Oct 22 06:47:42 UTC 2015 - jweberhofer@weberhofer.at
- python-systemd-libraries-for-opensuse-1310.patch allows compilation
on openSUSE 13.1
-------------------------------------------------------------------
Mon Oct 19 06:20:31 UTC 2015 - jweberhofer@weberhofer.at
- Initial release 230
- This package is needed to resolve
bnc#917818 - fail2ban can not use systemd-journal to ban ips

76
python-systemd.spec Normal file
View File

@ -0,0 +1,76 @@
#
# spec file for package python-systemd
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?sle15_python_module_pythons}
Name: python-systemd
Version: 235
Release: 0
Summary: Python wrappers for systemd functionality
License: LGPL-2.1-or-later
Group: Development/Languages/Python
URL: https://github.com/systemd/python-systemd
Source: https://github.com/systemd/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
# PATCH-FIX-OPENSUSE iso-c-90.patch makes the building iso-c-90 compatible to allow building on SLE12 SP3
Patch1: iso-c-90.patch
# PATCH-FIX-OPENSUSE OBS_missing_etc_machine_id.patch gh#systemd/python-systemd#118 mcepl@suse.com
# build environment doesn't have /etc/machine-id
Patch2: OBS_missing_etc_machine_id.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: pkgconfig
BuildRequires: python-rpm-macros
BuildRequires: pkgconfig(libsystemd)
Requires: systemd
Suggests: %{name}-doc
# /SECTION
BuildRequires: %{python_module pytest}
%python_subpackages
%description
Python module for native access to the systemd facilities. Functionality is seperated into a number of modules:
* systemd.journal supports sending of structured messages to the journal and reading journal files,
* systemd.daemon wraps parts of libsystemd useful for writing daemons and socket activation,
* systemd.id128 provides functions for querying machine and boot identifiers and a lists of message identifiers provided by systemd,
* systemd.login wraps parts of libsystemd used to query logged in users and available seats and machines.
%prep
%autosetup -p1
%build
%pyproject_wheel
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%check
# Not sure about the first exclusion,
export PYTEST_ADDOPTS="-k 'not (test_reader_this_machine or test_get_machine)'"
%python_expand make PYTHON=python%{$python_version} check
%files %{python_files}
%license LICENSE.txt
%doc README.md
%{python_sitearch}/systemd
%{python_sitearch}/systemd_python-%{version}*-info
%changelog