From bedece9c7dccc9eae5753b81aefe22795708af58 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 11 Jan 2023 10:53:00 +0100 Subject: [PATCH] python310Packages.python-telegram-bot: 13.15 -> 20.0 --- .../python-telegram-bot/default.nix | 123 +++++++++++++----- 1 file changed, 92 insertions(+), 31 deletions(-) diff --git a/pkgs/development/python-modules/python-telegram-bot/default.nix b/pkgs/development/python-modules/python-telegram-bot/default.nix index f9154729bdb..11ad4e25d7b 100644 --- a/pkgs/development/python-modules/python-telegram-bot/default.nix +++ b/pkgs/development/python-modules/python-telegram-bot/default.nix @@ -1,59 +1,120 @@ { lib +, aiolimiter , APScheduler +, beautifulsoup4 , buildPythonPackage , cachetools -, certifi -, decorator -, fetchPypi -, future -, tornado -, urllib3 +, cryptography +, fetchFromGitHub +, flaky +, httpx +, pytest-asyncio +, pytest-timeout +, pytest-xdist +, pytestCheckHook , pythonOlder +, pytz +, tornado }: buildPythonPackage rec { pname = "python-telegram-bot"; - version = "13.15"; + version = "20.0"; format = "setuptools"; disabled = pythonOlder "3.7"; - src = fetchPypi { - inherit pname version; - hash = "sha256-tAR2BrgIG2K71qo2H3yh7+h/qPGIHsnZMtNYRL9XoVQ="; + src = fetchFromGitHub { + owner = pname; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-34Apzy7id+fDxTN935hPT0HeZNZMEdQqZ0aiV0trAxE="; }; propagatedBuildInputs = [ + aiolimiter APScheduler cachetools - certifi - decorator - future + cryptography + httpx + pytz + ] ++ httpx.optional-dependencies.socks; + + checkInputs = [ + beautifulsoup4 + flaky + pytest-asyncio + pytest-timeout + pytest-xdist + pytestCheckHook tornado - urllib3 ]; - # --with-upstream-urllib3 is not working properly - postPatch = '' - rm -r telegram/vendor - - substituteInPlace requirements.txt \ - --replace "APScheduler==3.6.3" "APScheduler" \ - --replace "cachetools==4.2.2" "cachetools" \ - --replace "tornado==6.1" "tornado" - ''; - - setupPyGlobalFlags = [ - "--with-upstream-urllib3" - ]; - - # Tests not included with release - doCheck = false; - pythonImportsCheck = [ "telegram" ]; + disabledTests = [ + # Tests require network access + "TestAIO" + "TestAnimation" + "TestApplication" + "TestAudio" + "TestBase" + "TestBot" + "TestCallback" + "TestChat" + "TestChosenInlineResult" + "TestCommandHandler" + "TestConstants" + "TestContact" + "TestConversationHandler" + "TestDice" + "TestDict" + "TestDocument" + "TestFile" + "TestForceReply" + "TestForum" + "TestGame" + "TestGet" + "TestHTTP" + "TestInline" + "TestInput" + "TestInvoice" + "TestJob" + "TestKeyboard" + "TestLocation" + "TestMask" + "TestMenu" + "TestMessage" + "TestMeta" + "TestOrder" + "TestPassport" + "TestPhoto" + "TestPickle" + "TestPoll" + "TestPre" + "TestPrefix" + "TestProximity" + "TestReply" + "TestRequest" + "TestSend" + "TestSent" + "TestShipping" + "TestSlot" + "TestSticker" + "TestString" + "TestSuccess" + "TestTelegram" + "TestType" + "TestUpdate" + "TestUser" + "TestVenue" + "TestVideo" + "TestVoice" + "TestWeb" + ]; + meta = with lib; { description = "Python library to interface with the Telegram Bot API"; homepage = "https://python-telegram-bot.org";