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";