1{
2 lib,
3 aiodns,
4 aiofiles,
5 aiohttp-socks,
6 aiohttp,
7 aresponses,
8 babel,
9 buildPythonPackage,
10 certifi,
11 fetchFromGitHub,
12 gitUpdater,
13 hatchling,
14 magic-filter,
15 motor,
16 pycryptodomex,
17 pydantic,
18 pymongo,
19 pytest-aiohttp,
20 pytest-asyncio,
21 pytest-lazy-fixture,
22 pytestCheckHook,
23 pythonOlder,
24 pytz,
25 redis,
26 uvloop,
27}:
28
29buildPythonPackage rec {
30 pname = "aiogram";
31 version = "3.21.0";
32 pyproject = true;
33
34 disabled = pythonOlder "3.9";
35
36 src = fetchFromGitHub {
37 owner = "aiogram";
38 repo = "aiogram";
39 tag = "v${version}";
40 hash = "sha256-2DRKJiIZXMK2PgAQFfa0GBgVITiOrNQTM8/fnCHiiw8=";
41 };
42
43 build-system = [ hatchling ];
44
45 pythonRelaxDeps = [ "aiohttp" ];
46
47 dependencies = [
48 aiofiles
49 aiohttp
50 certifi
51 magic-filter
52 pydantic
53 ];
54
55 optional-dependencies = {
56 fast = [
57 aiodns
58 uvloop
59 ];
60 mongo = [
61 motor
62 pymongo
63 ];
64 redis = [ redis ];
65 proxy = [ aiohttp-socks ];
66 i18n = [ babel ];
67 };
68
69 nativeCheckInputs = [
70 aresponses
71 pycryptodomex
72 pytest-aiohttp
73 pytest-asyncio
74 pytest-lazy-fixture
75 pytestCheckHook
76 pytz
77 ]
78 ++ lib.flatten (builtins.attrValues optional-dependencies);
79
80 pythonImportsCheck = [ "aiogram" ];
81
82 passthru.updateScript = gitUpdater {
83 rev-prefix = "v";
84 ignoredVersions = "4.1";
85 };
86
87 __darwinAllowLocalNetworking = true;
88
89 meta = {
90 description = "Modern and fully asynchronous framework for Telegram Bot API";
91 homepage = "https://github.com/aiogram/aiogram";
92 changelog = "https://github.com/aiogram/aiogram/releases/tag/${src.tag}";
93 license = lib.licenses.mit;
94 maintainers = with lib.maintainers; [ sikmir ];
95 };
96}