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, sqlalchemy
19, asyncpg
20}:
21
22buildPythonPackage rec {
23 pname = "mautrix";
24 version = "0.19.16";
25 format = "setuptools";
26
27 disabled = pythonOlder "3.8";
28
29 src = fetchFromGitHub {
30 owner = "mautrix";
31 repo = "python";
32 rev = "refs/tags/v${version}";
33 hash = "sha256-aZlc4+J5Q+N9qEzGUMhsYguPdUy+E5I06wrjVyqvVDk=";
34 };
35
36 propagatedBuildInputs = [
37 aiohttp
38 attrs
39 yarl
40 ];
41
42 passthru.optional-dependencies = {
43 detect_mimetype = [
44 python-magic
45 ];
46 encryption = [
47 python-olm
48 unpaddedbase64
49 pycryptodome
50 ];
51 };
52
53 nativeCheckInputs = [
54 pytestCheckHook
55 ];
56
57 checkInputs = [
58 pytest-asyncio
59 aiosqlite
60 sqlalchemy
61 asyncpg
62 ] ++ passthru.optional-dependencies.encryption;
63
64 SQLALCHEMY_SILENCE_UBER_WARNING = 1;
65
66 disabledTestPaths = [
67 # sqlalchemy 2 unsupported
68 "mautrix/client/state_store/tests/store_test.py"
69 ];
70
71 pythonImportsCheck = [
72 "mautrix"
73 ];
74
75 meta = with lib; {
76 description = "Asyncio Matrix framework";
77 homepage = "https://github.com/tulir/mautrix-python";
78 changelog = "https://github.com/mautrix/python/releases/tag/v${version}";
79 license = licenses.mpl20;
80 maintainers = with maintainers; [ nyanloutre ma27 sumnerevans nickcao ];
81 };
82}