From 21f12f0d5aea4eee7e37df399458e0f4788b8e99 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Tue, 22 Oct 2024 17:08:38 -0400 Subject: [PATCH] python312Packages.telethon: 1.26.1 -> 1.37.0, modernize Diff: https://github.com/LonamiWebs/Telethon/compare/refs/tags/v1.26.1...v1.37.0 --- .../python-modules/telethon/default.nix | 38 ++++++++++++------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/telethon/default.nix b/pkgs/development/python-modules/telethon/default.nix index b349c470f8fe..ab0a973a86e1 100644 --- a/pkgs/development/python-modules/telethon/default.nix +++ b/pkgs/development/python-modules/telethon/default.nix @@ -5,6 +5,7 @@ openssl, rsa, pyaes, + cryptg, pythonOlder, setuptools, pytest-asyncio, @@ -13,40 +14,51 @@ buildPythonPackage rec { pname = "telethon"; - version = "1.26.1"; - format = "pyproject"; + version = "1.37.0"; + pyproject = true; + disabled = pythonOlder "3.5"; src = fetchFromGitHub { owner = "LonamiWebs"; repo = "Telethon"; rev = "refs/tags/v${version}"; - hash = "sha256-RxnC+PVSnLeCZ1xap6n6CjpeA8Ig6oLGiB0LDxqUmsA="; + hash = "sha256-P7FP+Wqi3dqbBCFpI9aCDvK4k3mWv8076RO6MXg+jFQ="; }; patchPhase = '' - substituteInPlace telethon/crypto/libssl.py --replace \ + substituteInPlace telethon/crypto/libssl.py --replace-fail \ "ctypes.util.find_library('ssl')" "'${lib.getLib openssl}/lib/libssl.so'" ''; - nativeBuildInputs = [ setuptools ]; - - propagatedBuildInputs = [ - rsa - pyaes + build-system = [ + setuptools ]; + dependencies = [ + pyaes + rsa + ]; + + optional-dependencies = { + cryptg = [ cryptg ]; + }; + nativeCheckInputs = [ pytest-asyncio pytestCheckHook ]; - pytestFlagsArray = [ "tests/telethon" ]; + disabledTests = [ + # https://github.com/LonamiWebs/Telethon/issues/4254 + "test_all_methods_present" + "test_private_get_extension" + ]; - meta = with lib; { + meta = { homepage = "https://github.com/LonamiWebs/Telethon"; description = "Full-featured Telegram client library for Python 3"; - license = licenses.mit; - maintainers = with maintainers; [ nyanloutre ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ nyanloutre ]; }; }