From c70b58962e8cd454173901ca04a2deef83a420bf Mon Sep 17 00:00:00 2001 From: nyanloutre Date: Mon, 25 Aug 2025 10:04:28 +0000 Subject: [PATCH] python3Packages.telethon: 1.37.0 -> 1.40.0 fix tests in new version --- .../python-modules/telethon/default.nix | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/telethon/default.nix b/pkgs/development/python-modules/telethon/default.nix index 71cabb331870..b48ef2157e4f 100644 --- a/pkgs/development/python-modules/telethon/default.nix +++ b/pkgs/development/python-modules/telethon/default.nix @@ -2,6 +2,7 @@ lib, buildPythonPackage, fetchFromGitHub, + fetchpatch, openssl, rsa, pyaes, @@ -14,7 +15,7 @@ buildPythonPackage rec { pname = "telethon"; - version = "1.37.0"; + version = "1.40.0"; pyproject = true; disabled = pythonOlder "3.5"; @@ -23,10 +24,26 @@ buildPythonPackage rec { owner = "LonamiWebs"; repo = "Telethon"; tag = "v${version}"; - hash = "sha256-P7FP+Wqi3dqbBCFpI9aCDvK4k3mWv8076RO6MXg+jFQ="; + hash = "sha256-y8nMh2dAy5ixATYGjH04FtfpvhO2HU5HRTXBr7Z+Dds="; }; - patchPhase = '' + patches = [ + # https://github.com/LonamiWebs/Telethon/pull/4670 + (fetchpatch { + url = "https://github.com/LonamiWebs/Telethon/commit/8e2a46568ef9193f5887aea1abf919ac4ca6d31e.patch"; + name = "fix_async_test.patch"; + hash = "sha256-oVpLnO4OxNam/mq945OskVEHkbS5TDSUXk/0xPHVv3I="; + }) + ] + ++ lib.optionals (lib.versionOlder version "1.40.1") [ + (fetchpatch { + url = "https://github.com/LonamiWebs/Telethon/commit/ae9c798e2c3648ff40dee1b3f371f5d66851642e.patch"; + name = "fix_test_messages_test.patch"; + hash = "sha256-8SJm8EE6w7zRQxt1NuTX6KP1MTYPiYO/maJ5tOA2I9w="; + }) + ]; + + postPatch = '' substituteInPlace telethon/crypto/libssl.py --replace-fail \ "ctypes.util.find_library('ssl')" "'${lib.getLib openssl}/lib/libssl.so'" ''; @@ -49,16 +66,11 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTests = [ - # https://github.com/LonamiWebs/Telethon/issues/4254 - "test_all_methods_present" - "test_private_get_extension" - ]; - meta = { homepage = "https://github.com/LonamiWebs/Telethon"; description = "Full-featured Telegram client library for Python 3"; license = lib.licenses.mit; + changelog = "https://github.com/LonamiWebs/Telethon/blob/${src.tag}/readthedocs/misc/changelog.rst"; maintainers = with lib.maintainers; [ nyanloutre ]; }; }