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.15.0";
32 pyproject = true;
33
34 disabled = pythonOlder "3.9";
35
36 src = fetchFromGitHub {
37 owner = "aiogram";
38 repo = "aiogram";
39 rev = "refs/tags/v${version}";
40 hash = "sha256-heCebvYP1rrExuD7tAMwSsBsds0cbsPvzHLUtBjNwW0=";
41 };
42
43 build-system = [ hatchling ];
44
45 dependencies = [
46 aiofiles
47 aiohttp
48 certifi
49 magic-filter
50 pydantic
51 ];
52
53 optional-dependencies = {
54 fast = [
55 aiodns
56 uvloop
57 ];
58 mongo = [
59 motor
60 pymongo
61 ];
62 redis = [ redis ];
63 proxy = [ aiohttp-socks ];
64 i18n = [ babel ];
65 };
66
67 nativeCheckInputs = [
68 aresponses
69 pycryptodomex
70 pytest-aiohttp
71 pytest-asyncio
72 pytest-lazy-fixture
73 pytestCheckHook
74 pytz
75 ] ++ lib.flatten (builtins.attrValues optional-dependencies);
76
77 pytestFlagsArray = [
78 "-W"
79 "ignore::pluggy.PluggyTeardownRaisedWarning"
80 "-W"
81 "ignore::pytest.PytestDeprecationWarning"
82 "-W"
83 "ignore::DeprecationWarning"
84 ];
85
86 pythonImportsCheck = [ "aiogram" ];
87
88 passthru.updateScript = gitUpdater { rev-prefix = "v"; };
89
90 __darwinAllowLocalNetworking = true;
91
92 meta = with lib; {
93 description = "Modern and fully asynchronous framework for Telegram Bot API";
94 homepage = "https://github.com/aiogram/aiogram";
95 changelog = "https://github.com/aiogram/aiogram/releases/tag/v${version}";
96 license = licenses.mit;
97 maintainers = with maintainers; [ sikmir ];
98 };
99}