1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, pytestCheckHook
6, aiohttp
7, aiohttp-socks
8, aioredis
9, aresponses
10, babel
11, certifi
12, magic-filter
13, pytest-asyncio
14, pytest-lazy-fixture
15, redis
16}:
17
18buildPythonPackage rec {
19 pname = "aiogram";
20 version = "3.0.0";
21 format = "setuptools";
22
23 disabled = pythonOlder "3.7";
24
25 src = fetchFromGitHub {
26 owner = "aiogram";
27 repo = "aiogram";
28 rev = "refs/tags/v${version}";
29 hash = "sha256-bWwK761gn7HsR9ObcBDfvQH0fJfTAo0QAcL/HcNdHik=";
30 };
31
32 postPatch = ''
33 substituteInPlace setup.py \
34 --replace "aiohttp>=3.8.0,<3.9.0" "aiohttp" \
35 --replace "Babel>=2.9.1,<2.10.0" "Babel" \
36 --replace "magic-filter>=1.0.9" "magic-filter"
37 '';
38
39 propagatedBuildInputs = [
40 aiohttp
41 babel
42 certifi
43 magic-filter
44 ];
45
46 nativeCheckInputs = [
47 aiohttp-socks
48 aioredis
49 aresponses
50 pytest-asyncio
51 pytest-lazy-fixture
52 pytestCheckHook
53 redis
54 ];
55
56 # requires network
57 disabledTests = [
58 "test_download_file_404"
59 "test_download_404"
60 ];
61
62 pythonImportsCheck = [ "aiogram" ];
63
64 meta = with lib; {
65 description = "Modern and fully asynchronous framework for Telegram Bot API";
66 homepage = "https://github.com/aiogram/aiogram";
67 changelog = "https://github.com/aiogram/aiogram/releases/tag/v${version}";
68 license = licenses.mit;
69 maintainers = with maintainers; [ sikmir ];
70 };
71}