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.20.0.post0";
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-OQH5wes2RGSbT9GPKcZVVxpsFbtOnXd6aAeYfQST1Xs=";
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 ] ++ lib.flatten (builtins.attrValues optional-dependencies);
78
79 pythonImportsCheck = [ "aiogram" ];
80
81 passthru.updateScript = gitUpdater {
82 rev-prefix = "v";
83 ignoredVersions = "4.1";
84 };
85
86 __darwinAllowLocalNetworking = true;
87
88 meta = {
89 description = "Modern and fully asynchronous framework for Telegram Bot API";
90 homepage = "https://github.com/aiogram/aiogram";
91 changelog = "https://github.com/aiogram/aiogram/releases/tag/${src.tag}";
92 license = lib.licenses.mit;
93 maintainers = with lib.maintainers; [ sikmir ];
94 };
95}