File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ """Minimal `_libolm` shim for mautrix when running with fresholm.
2+
3+ fresholm provides a python-olm compatible `olm` module, but does not ship the
4+ CFFI `_libolm` extension. mautrix imports `_libolm` for an optional debug
5+ method. This shim keeps that import working without requiring libolm.
6+ """
7+
8+
9+ class _DummyFFI :
10+ """Placeholder object to satisfy mautrix import-time expectations."""
11+
12+
13+ class _DummyLib :
14+ """Placeholder object; no `olm_session_describe` means graceful fallback."""
15+
16+
17+ ffi = _DummyFFI ()
18+ lib = _DummyLib ()
Original file line number Diff line number Diff line change 2121from pathlib import Path
2222from typing import cast
2323
24+ import fresholm .import_hook # noqa: F401
2425from aiohttp import ClientSession , TCPConnector
2526from aiohttp_socks import ProxyConnector
2627from mautrix .api import HTTPAPI
Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ dependencies = [
3131 " pillow>=12.2.0" ,
3232 " fastapi>=0.135.3" ,
3333 " uvicorn>=0.43.0" ,
34+ " fresholm>=0.2.4" ,
35+ " tzlocal>=5.3.1" ,
3436]
3537
3638[[tool .uv .index ]]
@@ -51,7 +53,7 @@ indent-width = 4
5153
5254[tool .ruff .lint ]
5355ignore = [
54- " E741" , # Ambiguous variable name: l / O / I
56+ " E741" , # Ambiguous variable name: l / O / I
5557]
5658
5759[dependency-groups ]
Original file line number Diff line number Diff line change @@ -363,6 +363,7 @@ cryptography==46.0.6 \
363363 # via
364364 # alibabacloud-openapi-util
365365 # alibabacloud-tea-openapi
366+ # fresholm
366367 # google-auth
367368darabonba-core == 1.0.5 \
368369 --hash =sha256:671ab8dbc4edc2a8f88013da71646839bb8914f1259efc069353243ef52ea27c
@@ -375,6 +376,13 @@ fastapi==0.135.3 \
375376 --hash =sha256:9b0f590c813acd13d0ab43dd8494138eb58e484bfac405db1f3187cfc5810d98 \
376377 --hash =sha256:bd6d7caf1a2bdd8d676843cdcd2287729572a1ef524fc4d65c17ae002a1be654
377378 # via nextbridge
379+ fresholm == 0.2.4 \
380+ --hash =sha256:556e84a5e9a6ae2f18fc9518d93647056de7ca03bdf44adc91c49afeba3abfc7 \
381+ --hash =sha256:5dd950f0fb66dedfbd07153dff0511025cf391e92d40bc623a9a7c2e0cd5a316 \
382+ --hash =sha256:705a106c036fb4a8e859493bdbc221196135dc7cbd774fca57d987d7f92718ae \
383+ --hash =sha256:d4350ba5b0a2ef2652b9c42dccca2f504843c0fc5e61e8020ae17e36a38a8573 \
384+ --hash =sha256:e334528330a9aac8fb7a74388972c1a55f8f5d33dc0bcf4aaec5f34341bb47cd
385+ # via nextbridge
378386frozenlist == 1.8.0 \
379387 --hash =sha256:0325024fe97f94c41c08872db482cf8ac4800d80e79222c6b0b7b162d5b13686 \
380388 --hash =sha256:032efa2674356903cd0261c4317a561a6850f3ac864a63fc1583147fb05a79b0 \
You can’t perform that action at this time.
0 commit comments