From e3c041bc208ef4a801aea7e14104779537b89306 Mon Sep 17 00:00:00 2001 From: leschinskiy Date: Tue, 14 Jul 2026 11:46:38 +1000 Subject: [PATCH] python3Packages.telethon: 1.42.0 -> 1.44.0 https://codeberg.org/Lonami/Telethon/blob/v1.44.0/readthedocs/misc/changelog.rst - switch build-system to hatchling (upstream moved to a hatch build hook) - remove telethon sources before running tests: TL objects are generated by the build hook and only exist in the wheel, so the source tree shadows the installed package during pytest collection - drop 'disabled = pythonAtLeast "3.14"': upstream fixed Python 3.14 support and the test suite passes on 3.13 and 3.14 - this also fixes the check phase failure on Python 3.13.14 (test_sync_acontext, get_event_loop behavior change) --- .../python-modules/telethon/default.nix | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/telethon/default.nix b/pkgs/development/python-modules/telethon/default.nix index b33247ebf0bb..93882deec67e 100644 --- a/pkgs/development/python-modules/telethon/default.nix +++ b/pkgs/development/python-modules/telethon/default.nix @@ -2,37 +2,34 @@ lib, buildPythonPackage, fetchFromCodeberg, - pythonAtLeast, openssl, rsa, pyaes, cryptg, - setuptools, + hatchling, pytest-asyncio, pytestCheckHook, }: buildPythonPackage (finalAttrs: { pname = "telethon"; - version = "1.42.0"; + version = "1.44.0"; pyproject = true; src = fetchFromCodeberg { owner = "Lonami"; repo = "Telethon"; tag = "v${finalAttrs.version}"; - hash = "sha256-NMHJkSTGR3/tck0k97EfVN9f85PAWst+EZ6G7Tgrt5s="; + hash = "sha256-NzLlDwxzLWyySluUazQGPDukT71awCrJZEbjd5T9K/g="; }; - disabled = pythonAtLeast "3.14"; - postPatch = '' substituteInPlace telethon/crypto/libssl.py --replace-fail \ "ctypes.util.find_library('ssl')" "'${lib.getLib openssl}/lib/libssl.so'" ''; build-system = [ - setuptools + hatchling ]; dependencies = [ @@ -50,6 +47,15 @@ buildPythonPackage (finalAttrs: { ] ++ lib.concatAttrValues finalAttrs.passthru.optional-dependencies; + # TL objects (telethon/tl/functions.py etc.) are generated by the hatch build + # hook and only exist in the wheel; remove the source tree so tests import + # the installed package instead of the incomplete sources. + preCheck = '' + rm -r telethon + ''; + + pythonImportsCheck = [ "telethon" ]; + meta = { homepage = "https://codeberg.org/Lonami/Telethon"; description = "Full-featured Telegram client library for Python 3";