1{
2 lib,
3 aiohttp,
4 aioredis,
5 buildPythonPackage,
6 coloredlogs,
7 fastapi,
8 fetchFromGitHub,
9 hatchling,
10 pillow,
11 psutil,
12 pytestCheckHook,
13 pythonOlder,
14 redis,
15 requests,
16 ujson,
17 uvicorn,
18 watchdog,
19}:
20
21buildPythonPackage rec {
22 pname = "pytelegrambotapi";
23 version = "4.29.1";
24 pyproject = true;
25
26 disabled = pythonOlder "3.9";
27
28 src = fetchFromGitHub {
29 owner = "eternnoir";
30 repo = "pyTelegramBotAPI";
31 tag = version;
32 hash = "sha256-djiuIHTcPiKIfMxFevCa4c3V8ydGpSqH4mo0qH+Cpw8=";
33 };
34
35 build-system = [ hatchling ];
36
37 optional-dependencies = {
38 json = [ ujson ];
39 PIL = [ pillow ];
40 redis = [ redis ];
41 aioredis = [ aioredis ];
42 aiohttp = [ aiohttp ];
43 fastapi = [ fastapi ];
44 uvicorn = [ uvicorn ];
45 psutil = [ psutil ];
46 coloredlogs = [ coloredlogs ];
47 watchdog = [ watchdog ];
48 };
49
50 checkInputs = [
51 pytestCheckHook
52 requests
53 ]
54 ++ optional-dependencies.watchdog
55 ++ optional-dependencies.aiohttp;
56
57 pythonImportsCheck = [ "telebot" ];
58
59 meta = with lib; {
60 description = "Python implementation for the Telegram Bot API";
61 homepage = "https://github.com/eternnoir/pyTelegramBotAPI";
62 changelog = "https://github.com/eternnoir/pyTelegramBotAPI/releases/tag/${src.tag}";
63 license = licenses.gpl2Only;
64 maintainers = with maintainers; [ das_j ];
65 };
66}