1{
2 lib,
3 aiolimiter,
4 apscheduler,
5 beautifulsoup4,
6 buildPythonPackage,
7 cachetools,
8 cryptography,
9 fetchFromGitHub,
10 flaky,
11 httpx,
12 pytest-asyncio,
13 pytest-timeout,
14 pytest-xdist,
15 pytestCheckHook,
16 pythonOlder,
17 pytz,
18 setuptools,
19 tornado,
20}:
21
22buildPythonPackage rec {
23 pname = "python-telegram-bot";
24 version = "21.2";
25 pyproject = true;
26
27 disabled = pythonOlder "3.8";
28
29 src = fetchFromGitHub {
30 owner = "python-telegram-bot";
31 repo = "python-telegram-bot";
32 rev = "refs/tags/v${version}";
33 hash = "sha256-l5twJbyZh30+pt9DsCpQRuSav8qYNGlIhQW0qY9BmO4=";
34 };
35
36 build-system = [ setuptools ];
37
38 dependencies = [
39 aiolimiter
40 apscheduler
41 cachetools
42 cryptography
43 httpx
44 pytz
45 ] ++ httpx.optional-dependencies.socks ++ httpx.optional-dependencies.http2;
46
47 nativeCheckInputs = [
48 beautifulsoup4
49 flaky
50 pytest-asyncio
51 pytest-timeout
52 pytest-xdist
53 pytestCheckHook
54 tornado
55 ];
56
57 pythonImportsCheck = [ "telegram" ];
58
59 disabledTests = [
60 # Tests require network access
61 "TestAIO"
62 "TestAnimation"
63 "TestApplication"
64 "TestAudio"
65 "TestBase"
66 "TestBot"
67 "TestCallback"
68 "TestChat"
69 "TestChosenInlineResult"
70 "TestCommandHandler"
71 "TestConstants"
72 "TestContact"
73 "TestConversationHandler"
74 "TestDice"
75 "TestDict"
76 "TestDocument"
77 "TestFile"
78 "TestForceReply"
79 "TestForum"
80 "TestGame"
81 "TestGet"
82 "TestHTTP"
83 "TestInline"
84 "TestInput"
85 "TestInvoice"
86 "TestJob"
87 "TestKeyboard"
88 "TestLocation"
89 "TestMask"
90 "TestMenu"
91 "TestMessage"
92 "TestMeta"
93 "TestOrder"
94 "TestPassport"
95 "TestPhoto"
96 "TestPickle"
97 "TestPoll"
98 "TestPre"
99 "TestPrefix"
100 "TestProximity"
101 "TestReply"
102 "TestRequest"
103 "TestSend"
104 "TestSent"
105 "TestShipping"
106 "TestSlot"
107 "TestSticker"
108 "TestString"
109 "TestSuccess"
110 "TestTelegram"
111 "TestType"
112 "TestUpdate"
113 "TestUser"
114 "TestVenue"
115 "TestVideo"
116 "TestVoice"
117 "TestWeb"
118 ];
119
120 meta = with lib; {
121 description = "Python library to interface with the Telegram Bot API";
122 homepage = "https://python-telegram-bot.org";
123 changelog = "https://github.com/python-telegram-bot/python-telegram-bot/blob/v${version}/CHANGES.rst";
124 license = licenses.lgpl3Only;
125 maintainers = with maintainers; [
126 veprbl
127 pingiun
128 ];
129 };
130}