From 78d72304d50f33809954bb3d7659cb86b53b6021 Mon Sep 17 00:00:00 2001 From: Goffi Date: Fri, 20 Mar 2026 18:32:36 +0100 Subject: [PATCH] core: bye bye `sat_tmp` :) After 11 years of "temporary" monkey patches, I've finally made a friendly fork of Wokkel at https://www.goffi.org/forge/goffi/tx-xmpp with all needed PRs merged and changes from `sat_tmp`, using the same license as Wokkel (with agreement from contributors). No more monkey patching, and it will also stop the deprecation warning due to outdated packages used in Wokkel. Last but not least, it should unblock the move to the latest Twisted and Python versions. --- libervia/backend/__init__.py | 4 -- libervia/backend/core/xmpp.py | 3 +- .../plugins/plugin_misc_pubsub_contacts.py | 2 +- libervia/backend/plugins/plugin_xep_0004.py | 2 +- libervia/backend/plugins/plugin_xep_0277.py | 1 - libervia/backend/test/helpers_plugins.py | 3 +- libervia/backend/test/test_plugin_xep_0313.py | 5 +-- pyproject.toml | 5 +-- twisted/plugins/libervia_backend_plugin.py | 4 -- uv.lock | 42 ++++++------------- 10 files changed, 20 insertions(+), 51 deletions(-) diff --git a/libervia/backend/__init__.py b/libervia/backend/__init__.py index c33cb8a9..9563857a 100644 --- a/libervia/backend/__init__.py +++ b/libervia/backend/__init__.py @@ -16,13 +16,9 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . from typing import TYPE_CHECKING -from sat_tmp import wokkel __version__ = "0.9.0.dev0" -if not wokkel.installed: - wokkel.install() - if TYPE_CHECKING: from libervia.backend.core.main import LiberviaBackend from libervia.backend.memory.sqla import Storage diff --git a/libervia/backend/core/xmpp.py b/libervia/backend/core/xmpp.py index 82629cbe..bd89f570 100644 --- a/libervia/backend/core/xmpp.py +++ b/libervia/backend/core/xmpp.py @@ -2168,8 +2168,7 @@ class SatDiscoProtocol(disco.DiscoClientProtocol): disco.DiscoClientProtocol.__init__(self) def getDiscoInfo(self, requestor, target, nodeIdentifier=""): - # those features are implemented in Wokkel (or sat_tmp.wokkel) - # and thus are always available + # those features are implemented in Tx-XMPP and thus are always available return [ disco.DiscoFeature(NS_DISCO_INFO), ] diff --git a/libervia/backend/plugins/plugin_misc_pubsub_contacts.py b/libervia/backend/plugins/plugin_misc_pubsub_contacts.py index ed4137bb..34ecadb4 100644 --- a/libervia/backend/plugins/plugin_misc_pubsub_contacts.py +++ b/libervia/backend/plugins/plugin_misc_pubsub_contacts.py @@ -41,7 +41,7 @@ from libervia.backend.tools.xml_tools import find_ancestor if TYPE_CHECKING: from libervia.backend.core.main import LiberviaBackend - from sat_tmp.wokkel.pubsub import ItemsEvent + from wokkel.pubsub import ItemsEvent log = getLogger(__name__) diff --git a/libervia/backend/plugins/plugin_xep_0004.py b/libervia/backend/plugins/plugin_xep_0004.py index 0e528e6a..03adce08 100644 --- a/libervia/backend/plugins/plugin_xep_0004.py +++ b/libervia/backend/plugins/plugin_xep_0004.py @@ -48,7 +48,7 @@ PLUGIN_INFO = { C.PI_DESCRIPTION: _( "Implementation of data forms.\n" "This plugins extends Wokkel implementation with Pydantic models.\n" - # XXX: XEP-0315 is currently implemented in "sat_tmp.wokkel.data_form" + # XXX: XEP-0315 is currently implemented in Tx-XMPP "XEP-0315 (Data Forms XML Element) is also supported here." ), } diff --git a/libervia/backend/plugins/plugin_xep_0277.py b/libervia/backend/plugins/plugin_xep_0277.py index ca99ad80..2f9ca2a1 100644 --- a/libervia/backend/plugins/plugin_xep_0277.py +++ b/libervia/backend/plugins/plugin_xep_0277.py @@ -34,7 +34,6 @@ from twisted.words.xish import domish from twisted.internet import defer from twisted.python import failure -# XXX: sat_tmp.wokkel.pubsub is actually used instead of wokkel version from wokkel import pubsub from wokkel import disco, iwokkel, rsm from zope.interface import implementer diff --git a/libervia/backend/test/helpers_plugins.py b/libervia/backend/test/helpers_plugins.py index 0ec643a2..e48c91a2 100644 --- a/libervia/backend/test/helpers_plugins.py +++ b/libervia/backend/test/helpers_plugins.py @@ -26,8 +26,7 @@ from wokkel.muc import Room, User from wokkel.generic import parseXml from wokkel.disco import DiscoItem, DiscoItems -# temporary until the changes are integrated to Wokkel -from sat_tmp.wokkel.rsm import RSMResponse +from wokkel.rsm import RSMResponse from .constants import Const as C from libervia.backend.plugins import plugin_xep_0045 diff --git a/libervia/backend/test/test_plugin_xep_0313.py b/libervia/backend/test/test_plugin_xep_0313.py index 212d2c75..8a770634 100644 --- a/libervia/backend/test/test_plugin_xep_0313.py +++ b/libervia/backend/test/test_plugin_xep_0313.py @@ -29,9 +29,8 @@ from wokkel.data_form import Field from dateutil.tz import tzutc import datetime -# TODO: change this when RSM and MAM are in wokkel -from sat_tmp.wokkel.rsm import RSMRequest -from sat_tmp.wokkel.mam import buildForm, MAMRequest +from wokkel.rsm import RSMRequest +from wokkel.mam import buildForm, MAMRequest NS_PUBSUB = "http://jabber.org/protocol/pubsub" SERVICE = "sat-pubsub.tazar.int" diff --git a/pyproject.toml b/pyproject.toml index 0257d162..dcc66199 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,7 +50,6 @@ dependencies = [ "python-xlib ~= 0.33", "prompt_toolkit ~= 3.0", "rich ~= 13.5", - "sat-tmp", "setuptools_scm", "shortuuid ~= 1.0.11", "sqlalchemy >= 1.4", @@ -63,8 +62,8 @@ dependencies = [ "txdbus", "urwid >= 1.2.0, < 3", "urwid-satext", - "wokkel >= 18.0.0, < 19.0.0", "xmlschema < 4.3.1", + "tx-xmpp", ] keywords = [ "XMPP", @@ -190,8 +189,8 @@ packages = ["libervia", "twisted"] addopts = "--reactor asyncio" [tool.uv.sources] -sat-tmp = { url = "https://repos.goffi.org/sat_tmp/archive/tip.tar.bz2" } urwid-satext = { url = "https://repos.goffi.org/urwid-satext/archive/tip.tar.bz2" } +tx-xmpp = { git = "https://www.goffi.org/forge/goffi/tx-xmpp" } [tool.hatch.version] diff --git a/twisted/plugins/libervia_backend_plugin.py b/twisted/plugins/libervia_backend_plugin.py index 1e69d87c..a39be561 100644 --- a/twisted/plugins/libervia_backend_plugin.py +++ b/twisted/plugins/libervia_backend_plugin.py @@ -28,10 +28,6 @@ from libervia.backend.core import exceptions from libervia.backend.core.constants import Const as C from libervia.backend.core.i18n import _ -from sat_tmp.wokkel import install as install_wokkel_patches - -install_wokkel_patches() - def initialise(options): """Method to initialise global modules""" diff --git a/uv.lock b/uv.lock index d1b5f44f..00d164e9 100644 --- a/uv.lock +++ b/uv.lock @@ -738,17 +738,16 @@ dependencies = [ { name = "python-xlib" }, { name = "pyyaml" }, { name = "rich" }, - { name = "sat-tmp" }, { name = "setuptools-scm" }, { name = "shortuuid" }, { name = "sqlalchemy" }, { name = "treq" }, { name = "twisted", extra = ["tls"] }, { name = "twomemo" }, + { name = "tx-xmpp" }, { name = "txdbus" }, { name = "urwid" }, { name = "urwid-satext" }, - { name = "wokkel" }, { name = "xmlschema" }, ] @@ -866,7 +865,6 @@ requires-dist = [ { name = "python-xlib", specifier = "~=0.33" }, { name = "pyyaml", specifier = "<7.0.0" }, { name = "rich", specifier = "~=13.5" }, - { name = "sat-tmp", url = "https://repos.goffi.org/sat_tmp/archive/tip.tar.bz2" }, { name = "setuptools-scm" }, { name = "shortuuid", specifier = "~=1.0.11" }, { name = "sqlalchemy", specifier = ">=1.4" }, @@ -876,13 +874,13 @@ requires-dist = [ { name = "treq", specifier = "~=24.9.0" }, { name = "twisted", extras = ["tls"], specifier = ">=22.10,<24.11.0" }, { name = "twomemo", specifier = ">=1.0.0,<2" }, + { name = "tx-xmpp", git = "https://www.goffi.org/forge/goffi/tx-xmpp" }, { name = "txdbus" }, { name = "txtorcon", marker = "extra == 'all'", specifier = "~=24.8.0" }, { name = "txtorcon", marker = "extra == 'main'", specifier = "~=24.8.0" }, { name = "txtorcon", marker = "extra == 'tor'", specifier = "~=24.8.0" }, { name = "urwid", specifier = ">=1.2.0,<3" }, { name = "urwid-satext", url = "https://repos.goffi.org/urwid-satext/archive/tip.tar.bz2" }, - { name = "wokkel", specifier = ">=18.0.0,<19.0.0" }, { name = "xmlschema", specifier = "<4.3.1" }, ] provides-extras = ["all", "conferences", "gui", "main", "netifaces", "ox", "remote-control", "svg", "tor", "tui", "webrtc"] @@ -1861,18 +1859,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/04/54/6f679c435d28e0a568d8e8a7c0a93a09010818634c3c3907fc98d8983770/roman_numerals-4.1.0-py3-none-any.whl", hash = "sha256:647ba99caddc2cc1e55a51e4360689115551bf4476d90e8162cf8c345fe233c7", size = 7676, upload-time = "2025-12-17T18:25:33.098Z" }, ] -[[package]] -name = "sat-tmp" -version = "0.9.dev0" -source = { url = "https://repos.goffi.org/sat_tmp/archive/tip.tar.bz2" } -dependencies = [ - { name = "wokkel" }, -] -sdist = { hash = "sha256:15ab3c6f72474d2145f386489711587e0348cb921116cbe554ce37f4b5e5bae4" } - -[package.metadata] -requires-dist = [{ name = "wokkel", specifier = "==18.0.0" }] - [[package]] name = "service-identity" version = "24.2.0" @@ -2213,6 +2199,16 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/ea/7c/3b36bf394b971d530a19b87c30209d4321ba8562c8ee2200d8f228564480/twomemo-1.2.0-py3-none-any.whl", hash = "sha256:c28bbdb58b4e4f32642a363e67faf11dfb5b929a0e956d5329e53edb5ec274ab", size = 19225, upload-time = "2025-06-24T02:04:02.42Z" }, ] +[[package]] +name = "tx-xmpp" +version = "0.9.0" +source = { git = "https://www.goffi.org/forge/goffi/tx-xmpp#48593e5eda0f77bd425ad76965c094f7cc9fa592" } +dependencies = [ + { name = "incremental" }, + { name = "python-dateutil" }, + { name = "twisted", extra = ["tls"] }, +] + [[package]] name = "txaio" version = "25.12.2" @@ -2329,20 +2325,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/f4/24/2a3e3df732393fed8b3ebf2ec078f05546de641fe1b667ee316ec1dcf3b7/webencodings-0.5.1-py2.py3-none-any.whl", hash = "sha256:a0af1213f3c2226497a97e2b3aa01a7e4bee4f403f95be16fc9acd2947514a78", size = 11774, upload-time = "2017-04-05T20:21:32.581Z" }, ] -[[package]] -name = "wokkel" -version = "18.0.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "incremental" }, - { name = "python-dateutil" }, - { name = "twisted", extra = ["tls"] }, -] -sdist = { url = "https://files.pythonhosted.org/packages/6a/77/0ed9531b5374bdd0537c3cba62b9fc4f43f02ffd2bdc7da0572b965fc61a/wokkel-18.0.0.tar.gz", hash = "sha256:2600ce5254a1a92b7c005791eeaf049303e6de9595ee163a8e5b3ff41e21f8ea", size = 119871, upload-time = "2018-12-04T10:22:35.069Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/c2/62/cac4da6c420a109b475b04f5685939222418eaa29abd6adbe3d039504ee5/wokkel-18.0.0-py2.py3-none-any.whl", hash = "sha256:d5116b8e3d807970beb3f7451f3a9187aa74148432c0031c3147031e6f15adb2", size = 131299, upload-time = "2018-12-04T10:22:32.739Z" }, -] - [[package]] name = "x3dh" version = "1.3.0"