# # spec file for package python-python-dbusmock # # Copyright (c) 2025 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/ # %global flavor %{nil} %if "%{flavor}" == "test" %define psuffix -test %bcond_without test %else %define psuffix %{nil} %bcond_with test %endif Name: python-python-dbusmock%{psuffix} Version: 0.34.2 Release: 1.3 Summary: Python library for creating mock D-Bus objects License: LGPL-3.0-or-later URL: https://github.com/martinpitt/python-dbusmock Source: https://files.pythonhosted.org/packages/source/p/python-dbusmock/python_dbusmock-%{version}.tar.gz BuildRequires: %{python_module dbus-python} BuildRequires: %{python_module gobject} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: pkgconfig BuildRequires: python-rpm-macros BuildRequires: pkgconfig(gobject-introspection-1.0) # SECTION test requirements %if %{with test} BuildRequires: %{python_module pytest} BuildRequires: %{python_module python-dbusmock = %{version}} BuildRequires: dbus-1-daemon BuildRequires: upower %endif #/ SECTION Requires: /usr/bin/dbus-daemon Requires: python-dbus-python Requires: python-gobject Provides: python-dbusmock = %{version} BuildArch: noarch %if %python_version_nodots < 37 Requires: python-dataclasses %endif %python_subpackages %description With this program/Python library, one can create mock objects on D-Bus. This is useful for writing tests for software which talks to D-Bus services such as upower, systemd, logind, gnome-session or others, and it is hard (or impossible without root privileges) to set the state of the real services to what one may expect in tests. %prep %autosetup -p1 -n python_dbusmock-%{version} %build %pyproject_wheel %install %if !%{with test} %pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %endif %check %if %{with test} %pytest %endif %if !%{with test} %files %{python_files} %license COPYING %doc NEWS README.md %{python_sitelib}/dbusmock %{python_sitelib}/python_dbusmock-%{version}*-info %endif %changelog * Fri Jan 24 2025 Joan Torres - Update to 0.34.2: * spec: Adjust %%autosetup to PEP-625 tarball top-level directory - Update to 0.34.1: * spec: Adjust Source URL to PEP-625 tarball name - Update to 0.34.0: * modemmanager: Add cell broadcast messages (thanks Guido Günther) * Move release builds to pybuild for PEP-625 compatibility * Thu Jan 23 2025 Joan Torres - Update to 0.33.0: * templates: Add gsd-rfkill (thanks Guido Günther) * Allow adding objects derived from DBusMockObject (thanks Sebastian Wick) * Drop Python <= 3.7 support (thanks Tomasz Kłoczko) - Update to 0.32.2: * all templates: Drop wrong variant wrapping from all properties * tests: Skip TestNetworkManager::test_one_wifi_with_accesspoints with NM ≥ 1.49.3 * Thu Nov 14 2024 Dominique Leuenberger - Split test suite off into a 2nd flavor (:test) to avoid buildcycle polkit -> upower -> python-dbusmock * Mon Oct 28 2024 Dominique Leuenberger - Replace dbus-1-x11 Requires with /usr/bin/dbus=daemon: this matches what the code actully uses and ensures we do not rely on legacy packages as good as possile. * Sun Aug 18 2024 Dirk Müller - update to 0.32.1: * ModemManager: Add initial mock * bluez5: Add advertising API * Fix loading of libglib on macOS * Sat Mar 16 2024 Dirk Müller - update to 0.31.1: * power_profiles_daemon: Move back to original D-Bus name to avoid breaking compatibility * Add upower_power_profiles_daemon template for version 0.20 API with new D-Bus name - update to 0.31.0: * power-profiles-daemon: Move to org.freedesktop.UPower.PowerProfiles as in release 0.20.0 * NetworkManager: Add stub ipv4/6 properties in AddWiFiConnection * Sun Jan 21 2024 Dirk Müller - update to 0.30.2: * bluez5: Fix invalid arguments to PairDevice - update to 0.30.1: * bluez: Clean up static default properties, re-drop PairDevice() `class_` parameter - update to 0.30.0: * api: Add pytest support and helpers * api: Factor the server spawning into a new SpawnedMock object * cli: Add support for running custom commands on the mock environment - update to 0.29.1: * spec: Update License: to SPDX format - update to 0.29.0: * Support loading templates from XDG_DATA_DIRS * iio-sensors-proxy: Throw proper D-Bus errors instead of Python Exception - update to 0.28.7: * blue5-obex template: Fix OBEX PullAll * power_profiles template: Fix Actions property type * README: Explain container tests and how to debug them - update to 0.28.6: * Fix generated _version.py in release tarball - update to 0.28.4: * setup.py: Fix ModuleNotFoundError * ofono template: Fix conversion to f-strings (Debian #1015286) * Ship FMF tests in release tarballs - update to 0.28.3: * Bring back dbusmock.__version__ - update to 0.28.2: * Dynamically compute version with setuptools-scm - update to 0.28.1: * Again works on RHEL/CentOS 8 (0.27 broke there), now in CI * Avoid glib GI dependency for main dbusmock, for running in virtualenv (thanks Allison Karlitskaya) - update to 0.27.5: * bluez and accountsservice templates: Drop default arguments from D-Bus methods (thanks Simon McVittie) - update to 0.27.4: * Fix D-Bus signature detection regression from 0.27.0 - update to 0.27.3: * packit: Fix file name to sync - update to 0.27.2: * packit: Really fix Fedora dist-git syncing - update to 0.27.1: * packit: Fix Fedora dist-git syncing - update to 0.27.0: * Do not register standard session service directories, add API to enable selected services (thanks Benjamin Berg) * Log static method calls from templates (thanks Peter Hutterer) - update to 0.26.1: * Fix README content type to Markdown, to fix releasing to PyPi - update to 0.26.0: * logind template: Add locking API (thanks Andy Holmes) * bluez5 template: Add RemoveDevice() and RemoveAdapterWithDevices() methods, * fix properties (thanks Bastien Nocera) * Documentation improvements, particularly wrt. raising errors - update to 0.25.0: * bluez template: Implement adapter discovery, connect, disconnect, and removal * Fix changing array properties (thanks Jonas Ådahl) * Fix CLI upower tests (thanks Marco Trevisan) * Wed Oct 11 2023 Simon Lees - dbusmock explicitly needs dbus-1-daemon to function (rather then dbus-broker) * Tue Apr 25 2023 Daniel Garcia - Removed not needed sle15modernpython macro * Wed Apr 12 2023 Matej Cepl - Switch to pyproject_* - Add missing BR on python-gobject. * Mon Dec 13 2021 Steve Kowalik - Update to 0.24.1: * Do not register standard D-Bus service directories (Thanks Benjamin Berg) * templates: Add IIO Sensors Proxy support (Thanks Marco Trevisan) * Fix importlib module import (Thanks Marco Trevisan) * Clean up code for most recent pylint version * Add Add power-profiles-daemon template (Thanks Bastien Nocera) * logind: Implement Inhibit and ListInhibitors (Thanks to Benjamin Berg) * Fix new complaints from pylint 2.9 * Fix tests for Python 3.10 * DBusMockObject: Add UpdateProperties() method (Thanks to Jonas Ådahl) * DBusTestCase: Add bus override argument to spawn_server_template, to use templates on either system or session bus; add corresponding --session CLI option * bluez template: Implement Pair() method on the Device interface and the AgentManager1 interface (Thanks to Bastien Nocera) * polkit template: Implement RegisterAuthenticationAgent() (Thanks to Jonas Ådahl) * Add accountsservice template (Thanks to Marco Trevisan) * NetworkManager template: Fix connecting to wifi * NetworkManager template: Add Reload() method * tests: Replace nose test runner with standard unittest * setup.py: Drop deprecated `test_suite`, run tests through `python3 -m unittest` directly * Add type annotations to the whole API * Drop obsolete ConsoleKit and bluez4 templates/tests * upower template: Drop support for 0.9 API * NetworkManager template: Handle NetworkingEnable * NetworkManager template: AddConnectionUnsaved * Drop support for Python 2 - Add python-dataclasses to {Build,}Requires * Fri Mar 20 2020 pgajdos@suse.com - version update to 0.19 - NetworkManager template: Add "StateReason" property and active connection ID - Add low-memory-monitor template * Thu Mar 12 2020 Tomáš Chvátal - Do not pull in py2 on python3 subpkg * Tue Feb 4 2020 Dominique Leuenberger - Require python-dbus-python: dbusmock can't work without this module. * Mon Oct 21 2019 Tomáš Chvátal - Update to 0.18.3: - Fix timeouts for loaded machines and parallel tests - Fix tests for Python 3.8 * Wed Jan 9 2019 Jan Engelhardt - Use noun phrase in summary. Trim description, it is not a manual. * Mon Jan 7 2019 bjorn.lie@gmail.com - Update URL to new home: * https://github.com/martinpitt/python-dbusmock * Mon Jan 7 2019 Tomáš Chvátal - Remove test condition - Use %%license macro * Mon Jan 7 2019 bjorn.lie@gmail.com - Update to version 0.18.1: * test: Fix failures with systemd 239 in chroots - Changes from version 0.18: * logind template: Add support for suspend-then-hibernate * NetworkManager template: Add GetConnectionByUuid method * bluez template: Add PairDevice() 'class_' parameter * Fix logging of unicode strings in Python 2 * Adjust logind and timedated tests to systemd 239 - Changes from version 0.17.2: * NetworkManager template: Add GetDeviceByIpIface() * Move release tarballs from Launchpad to remains as usual - Changes from version 0.17.1: * Fix NetworkManager tests due to name changes from 802-11-wireless to wifi - Changes from version 0.17: * Call dbus-daemon directly instead of dbus-launch * Fix DBusTestCase.stop_dbus() to actually enforce a timeout + Fix test_timedated for changed timedatectl output format in systemd 235. * Tue Nov 14 2017 toddrme2178@gmail.com - Provide/obsolete python-dbusmock * Wed Oct 18 2017 toddrme2178@gmail.com - Implement single-spec version - Rename to python-python-dbusmock to conform to python package naming rules - Update to version 0.16.9 * See changelog at https://github.com/martinpitt/python-dbusmock/blob/0.16.9/NEWS * Sat Mar 5 2016 sor.alexei@meowr.ru - Update to 0.16.3 (changes since 0.16.1): * NetworkManager template: Fix connection settings Updated signal emitted by wrong object. * NetworkManager template: Handle empty device at connection activation. * NetworkManager template: Implement secrets management in settings. * NetworkManager template test: Make the test run standalone. * Sat Oct 31 2015 sor.alexei@meowr.ru - Update to 0.16.1 (changes since 0.15.2): * NetworkManager template: Add missing properties to ethernet device and active connection. * Quiesce irrelevant PEP-8 errors with pep8 1.6. * NetworkManager template: Generate a new unused name in connection activation instead of just using the access point name. * Allow the passing of template parameters via the command-line as JSON strings. * NetworkManager template: Fix indexing bug in SettingsAddConnection. * Wed Aug 5 2015 sor.alexei@meowr.ru - Update to 0.15.2: * test_ofono: Do not check "private" fields. * timedated template: Add NTPSynchronized property and set it in SetNTP(). * Sun Jun 7 2015 sor.alexei@meowr.ru - Initial package.