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.21.0";
24 pyproject = true;
25
26 disabled = pythonOlder "3.7";
27
28 src = fetchFromGitHub {
29 owner = "eternnoir";
30 repo = "pyTelegramBotAPI";
31 rev = "refs/tags/${version}";
32 hash = "sha256-e0cyxwofixdtv3qNEAnb+dG2ya8wUqKmIx3hRGkFrpE=";
33 };
34
35 build-system = [ hatchling ];
36
37 passthru.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 ] ++ passthru.optional-dependencies.watchdog ++ passthru.optional-dependencies.aiohttp;
54
55 pythonImportsCheck = [ "telebot" ];
56
57 meta = with lib; {
58 description = "Python implementation for the Telegram Bot API";
59 homepage = "https://github.com/eternnoir/pyTelegramBotAPI";
60 changelog = "https://github.com/eternnoir/pyTelegramBotAPI/releases/tag/${version}";
61 license = licenses.gpl2Only;
62 maintainers = with maintainers; [ das_j ];
63 };
64}