diff options
Diffstat (limited to 'dev-python/dbus-next')
| -rw-r--r-- | dev-python/dbus-next/Manifest | 1 | ||||
| -rw-r--r-- | dev-python/dbus-next/dbus-next-0.2.3-r1.ebuild | 63 | ||||
| -rw-r--r-- | dev-python/dbus-next/files/dbus-next-0.2.3-glib-crash.patch | 33 | ||||
| -rw-r--r-- | dev-python/dbus-next/files/dbus-next-0.2.3-pytest-asyncio-1.patch | 115 | ||||
| -rw-r--r-- | dev-python/dbus-next/metadata.xml | 9 |
5 files changed, 221 insertions, 0 deletions
diff --git a/dev-python/dbus-next/Manifest b/dev-python/dbus-next/Manifest new file mode 100644 index 000000000000..684e05395861 --- /dev/null +++ b/dev-python/dbus-next/Manifest @@ -0,0 +1 @@ +DIST dbus-next-0.2.3.gh.tar.gz 81711 BLAKE2B 6acc38a05511b3de7e13893d82dd1ecd55f9a6124b4d859574294602b921ff012776c12ddb02e1be437b258c7bd5120a3a9625fc5b06bbbe02915dcc4c14897b SHA512 7836d855c755c8ac6cbbb251ca0cbd2f4df9b573f31b1ea1cab480e47896d36b4cb0d479b2469b0bf0b5c700068361a18874b4a087f73020cdcb4e04a2d7dbe7 diff --git a/dev-python/dbus-next/dbus-next-0.2.3-r1.ebuild b/dev-python/dbus-next/dbus-next-0.2.3-r1.ebuild new file mode 100644 index 000000000000..80e7038f634d --- /dev/null +++ b/dev-python/dbus-next/dbus-next-0.2.3-r1.ebuild @@ -0,0 +1,63 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{13..14} ) + +inherit distutils-r1 virtualx + +DESCRIPTION="The next great DBus library for Python with asyncio support" +HOMEPAGE=" + https://python-dbus-next.readthedocs.io/en/latest/ + https://github.com/altdesktop/python-dbus-next/ + https://pypi.org/project/dbus-next/ +" +SRC_URI=" + https://github.com/altdesktop/python-dbus-next/archive/v${PV}.tar.gz + -> ${P}.gh.tar.gz +" +S="${WORKDIR}"/python-${P} + +LICENSE="MIT" +SLOT="0" +KEYWORDS="amd64 arm64 ~riscv x86" + +BDEPEND=" + test? ( + dev-python/pygobject[${PYTHON_USEDEP}] + ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-0.2.3-glib-crash.patch + # https://github.com/altdesktop/python-dbus-next/pull/171 + "${FILESDIR}"/${PN}-0.2.3-pytest-asyncio-1.patch +) + +EPYTEST_DESELECT=( + # test does not work anymore with dbus 1.14.4+ + # https://github.com/altdesktop/python-dbus-next/issues/135 + test/test_tcp_address.py::test_tcp_connection_with_forwarding +) +EPYTEST_IGNORE=( + # "interface not found on this object: org.freedesktop.DBus.Debug.Stats" + # Seems like we build dbus w/o this? + test/client/test_signals.py +) + +EPYTEST_PLUGINS=( pytest-{asyncio,timeout} ) +EPYTEST_RERUNS=5 +distutils_enable_tests pytest + +src_test() { + local dbus_params=( + $(dbus-daemon --session --print-address --fork --print-pid) + ) + local -x DBUS_SESSION_BUS_ADDRESS=${dbus_params[0]} + + virtx distutils-r1_src_test + + kill "${dbus_params[1]}" || die +} diff --git a/dev-python/dbus-next/files/dbus-next-0.2.3-glib-crash.patch b/dev-python/dbus-next/files/dbus-next-0.2.3-glib-crash.patch new file mode 100644 index 000000000000..714d733f3689 --- /dev/null +++ b/dev-python/dbus-next/files/dbus-next-0.2.3-glib-crash.patch @@ -0,0 +1,33 @@ +https://github.com/altdesktop/python-dbus-next/pull/114 +https://github.com/altdesktop/python-dbus-next/issues/113 +https://gitlab.gnome.org/GNOME/pygobject/-/issues/525 + +From 445bc2cd0df80e36154e45ea3c4f268b550890b5 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue, 22 Mar 2022 22:11:01 +1000 +Subject: [PATCH] glib: destroy the _AuthLineSource explicitly + +See https://gitlab.gnome.org/GNOME/pygobject/-/issues/525 for an +explanation, the summary is: we need to explicitly call source.destroy() +if dispatch returns GLib.SOURCE_REMOVE. + +Deleting the source by resetting it to None causes invalid memory +accesses and eventual crashes. + +This can be reproduced with a basic call to + bus = dbus_next.glib.MessageBus(bus_type=dbus_next.BusType.SESSION).connect_sync() +and a GLib.MainLoop() after this call. Run in valgrind --tool=memcheck. + +Fixes #113 +--- a/dbus_next/glib/message_bus.py ++++ b/dbus_next/glib/message_bus.py +@@ -457,7 +457,7 @@ def line_notify(line): + self._stream.write(Authenticator._format_line(resp)) + self._stream.flush() + if resp == 'BEGIN': +- self._readline_source = None ++ self._readline_source.destroy() + authenticate_notify(None) + return True + except Exception as e: + diff --git a/dev-python/dbus-next/files/dbus-next-0.2.3-pytest-asyncio-1.patch b/dev-python/dbus-next/files/dbus-next-0.2.3-pytest-asyncio-1.patch new file mode 100644 index 000000000000..76506ddd0510 --- /dev/null +++ b/dev-python/dbus-next/files/dbus-next-0.2.3-pytest-asyncio-1.patch @@ -0,0 +1,115 @@ +From 37830c9972209746396f4c3f8344ce50a435b767 Mon Sep 17 00:00:00 2001 +From: LN Liberda <lauren@selfisekai.rocks> +Date: Fri, 28 Nov 2025 06:38:51 +0100 +Subject: [PATCH] Remove event_loop fixture from tests + +It was removed in pytest-asyncio 1.0 +https://github.com/pytest-dev/pytest-asyncio/pull/1106 +--- + test/test_aio_low_level.py | 4 +++- + test/test_disconnect.py | 7 +++++-- + test/test_fd_passing.py | 7 +++++-- + test/test_tcp_address.py | 3 ++- + 4 files changed, 15 insertions(+), 6 deletions(-) + +diff --git a/test/test_aio_low_level.py b/test/test_aio_low_level.py +index 1042a1a..677cbf1 100644 +--- a/test/test_aio_low_level.py ++++ b/test/test_aio_low_level.py +@@ -1,6 +1,7 @@ + from dbus_next.aio import MessageBus + from dbus_next import Message, MessageType, MessageFlag + ++import asyncio + import pytest + + +@@ -101,7 +102,8 @@ def message_handler_error(sent): + + + @pytest.mark.asyncio +-async def test_sending_signals_between_buses(event_loop): ++async def test_sending_signals_between_buses(): ++ event_loop = asyncio.get_running_loop() + bus1 = await MessageBus().connect() + bus2 = await MessageBus().connect() + +diff --git a/test/test_disconnect.py b/test/test_disconnect.py +index d04d996..987eefe 100644 +--- a/test/test_disconnect.py ++++ b/test/test_disconnect.py +@@ -1,15 +1,17 @@ + from dbus_next.aio import MessageBus + from dbus_next import Message + ++import asyncio + import os + import pytest + import functools + + + @pytest.mark.asyncio +-async def test_bus_disconnect_before_reply(event_loop): ++async def test_bus_disconnect_before_reply(): + '''In this test, the bus disconnects before the reply comes in. Make sure + the caller receives a reply with the error instead of hanging.''' ++ event_loop = asyncio.get_running_loop() + bus = MessageBus() + assert not bus.connected + await bus.connect() +@@ -32,7 +34,8 @@ async def test_bus_disconnect_before_reply(event_loop): + + + @pytest.mark.asyncio +-async def test_unexpected_disconnect(event_loop): ++async def test_unexpected_disconnect(): ++ event_loop = asyncio.get_running_loop() + bus = MessageBus() + assert not bus.connected + await bus.connect() +diff --git a/test/test_fd_passing.py b/test/test_fd_passing.py +index 28331d3..be25e4d 100644 +--- a/test/test_fd_passing.py ++++ b/test/test_fd_passing.py +@@ -5,6 +5,7 @@ + from dbus_next import Message, MessageType + import os + ++import asyncio + import pytest + + +@@ -112,7 +113,8 @@ def message_handler(sent): + + + @pytest.mark.asyncio +-async def test_high_level_service_fd_passing(event_loop): ++async def test_high_level_service_fd_passing(): ++ event_loop = asyncio.get_running_loop() + bus1 = await MessageBus(negotiate_unix_fd=True).connect() + bus2 = await MessageBus(negotiate_unix_fd=True).connect() + +@@ -212,7 +214,8 @@ def fd_listener(msg): + + + @pytest.mark.asyncio +-async def test_sending_file_descriptor_with_proxy(event_loop): ++async def test_sending_file_descriptor_with_proxy(): ++ event_loop = asyncio.get_running_loop() + name = 'dbus.next.test.service' + path = '/test/path' + interface_name = 'test.interface' +diff --git a/test/test_tcp_address.py b/test/test_tcp_address.py +index a6b6ebb..fe2fc3e 100644 +--- a/test/test_tcp_address.py ++++ b/test/test_tcp_address.py +@@ -8,7 +8,8 @@ + + + @pytest.mark.asyncio +-async def test_tcp_connection_with_forwarding(event_loop): ++async def test_tcp_connection_with_forwarding(): ++ event_loop = asyncio.get_running_loop() + closables = [] + host = '127.0.0.1' + port = '55556' diff --git a/dev-python/dbus-next/metadata.xml b/dev-python/dbus-next/metadata.xml new file mode 100644 index 000000000000..d34971a915e9 --- /dev/null +++ b/dev-python/dbus-next/metadata.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>python@gentoo.org</email> + </maintainer> + <stabilize-allarches /> + <origin>baldeagleos-repo</origin> +</pkgmetadata> |
