From d9f3a9d4fa87c5f0b11b8acc950800fa3a73e538 Mon Sep 17 00:00:00 2001 From: Hugh Nimmo-Smith Date: Thu, 27 Aug 2026 14:42:41 +0100 Subject: [PATCH] Expand `synapse.module_api.__all__` to include more of the publicly exposed types/helpers (#20107) I *think* the intention is that `__all__` can be used to access all the types that are exposed via the module API. However, some of them are missing. This PR adds those that are directly referenced but were not exposed. There are some others that are indirectly referenced that I've not included (e.g. `synapse.spam_checker_api.RegistrationBehaviour`). --- changelog.d/20107.misc | 1 + synapse/module_api/__init__.py | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 changelog.d/20107.misc diff --git a/changelog.d/20107.misc b/changelog.d/20107.misc new file mode 100644 index 0000000000..fb7a845252 --- /dev/null +++ b/changelog.d/20107.misc @@ -0,0 +1 @@ +Declare types that already appear in the module API's public signatures (such as `Requester`, `SynapseRequest` and `UserInfo`) in `synapse.module_api.__all__`. diff --git a/synapse/module_api/__init__.py b/synapse/module_api/__init__.py index 1be0e9fd91..58ccddc792 100644 --- a/synapse/module_api/__init__.py +++ b/synapse/module_api/__init__.py @@ -194,14 +194,21 @@ __all__ = [ "run_in_background", "run_as_background_process", "cached", + "CachedFunction", "NOT_SPAM", "UserID", + "DomainSpecificString", "DatabasePool", "LoggingTransaction", "DirectServeHtmlResource", "DirectServeJsonResource", + "SimpleHttpClient", + "SynapseRequest", "ModuleApi", + "AccountDataManager", + "PublicRoomListManager", "PRESENCE_ALL_USERS", + "UserPresenceState", "LoginResponse", "JsonDict", "JsonMapping", @@ -209,7 +216,13 @@ __all__ = [ "StateMap", "ProfileInfo", "RoomAlias", + "RoomID", + "Requester", + "UserInfo", + "UserIpAndAgent", "UserProfile", + "Absent", + "AbsentType", "RatelimitOverride", "MediaUploadLimit", ]