1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5 # deps
6, aiohttp
7, attrs
8, yarl
9 # optional deps
10, python-magic
11, python-olm
12, unpaddedbase64
13, pycryptodome
14 # check deps
15, pytestCheckHook
16, pytest-asyncio
17, aiosqlite
18, asyncpg
19}:
20
21buildPythonPackage rec {
22 pname = "mautrix";
23 version = "0.20.3";
24 format = "setuptools";
25
26 disabled = pythonOlder "3.9";
27
28 src = fetchFromGitHub {
29 owner = "mautrix";
30 repo = "python";
31 rev = "refs/tags/v${version}";
32 hash = "sha256-7ZSPxKRLAgwC1ECxa1eOTH60cMJXs1iv2PE2Vq9f0co=";
33 };
34
35 propagatedBuildInputs = [
36 aiohttp
37 attrs
38 yarl
39 ];
40
41 passthru.optional-dependencies = {
42 detect_mimetype = [
43 python-magic
44 ];
45 encryption = [
46 python-olm
47 unpaddedbase64
48 pycryptodome
49 ];
50 };
51
52 nativeCheckInputs = [
53 pytestCheckHook
54 ];
55
56 checkInputs = [
57 pytest-asyncio
58 aiosqlite
59 asyncpg
60 ] ++ passthru.optional-dependencies.encryption;
61
62 pythonImportsCheck = [
63 "mautrix"
64 ];
65
66 meta = with lib; {
67 description = "Asyncio Matrix framework";
68 homepage = "https://github.com/tulir/mautrix-python";
69 changelog = "https://github.com/mautrix/python/releases/tag/v${version}";
70 license = licenses.mpl20;
71 maintainers = with maintainers; [ nyanloutre ma27 sumnerevans nickcao ];
72 };
73}