nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, Logbook
5, aiofiles
6, aiohttp
7, aiohttp-socks
8, aioresponses
9, atomicwrites
10, attrs
11, cachetools
12, faker
13, future
14, git
15, h11
16, h2
17, hypothesis
18, jsonschema
19, peewee
20, poetry-core
21, pycryptodome
22, pytest-aiohttp
23, pytest-benchmark
24, pytestCheckHook
25, python-olm
26, unpaddedbase64
27}:
28
29buildPythonPackage rec {
30 pname = "matrix-nio";
31 version = "0.19.0";
32 format = "pyproject";
33
34 src = fetchFromGitHub {
35 owner = "poljar";
36 repo = "matrix-nio";
37 rev = version;
38 hash = "sha256-+WZk2m05y/bYj8zSuWTzm+rnCC0L9H9WNQ2RLXv7hDk=";
39 };
40
41 postPatch = ''
42 substituteInPlace pyproject.toml \
43 --replace 'aiofiles = "^0.6.0"' 'aiofiles = "*"' \
44 --replace 'h11 = "^0.12.0"' 'h11 = "*"' \
45 --replace 'jsonschema = "^3.2.0"' 'jsonschema = "*"' \
46 --replace 'cachetools = { version = "^4.2.1", optional = true }' 'cachetools = { version = "*", optional = true }'
47 '';
48
49 nativeBuildInputs = [
50 git
51 poetry-core
52 ];
53
54 propagatedBuildInputs = [
55 Logbook
56 aiofiles
57 aiohttp
58 aiohttp-socks
59 atomicwrites
60 attrs
61 cachetools
62 future
63 h11
64 h2
65 jsonschema
66 peewee
67 pycryptodome
68 python-olm
69 unpaddedbase64
70 ];
71
72 checkInputs = [
73 aioresponses
74 faker
75 hypothesis
76 pytest-aiohttp
77 pytest-benchmark
78 pytestCheckHook
79 ];
80
81 pytestFlagsArray = [ "--benchmark-disable" ];
82
83 disabledTests = [
84 # touches network
85 "test_connect_wrapper"
86 # time dependent and flaky
87 "test_transfer_monitor_callbacks"
88 ];
89
90 meta = with lib; {
91 homepage = "https://github.com/poljar/matrix-nio";
92 description = "A Python Matrix client library, designed according to sans I/O principles";
93 license = licenses.isc;
94 maintainers = with maintainers; [ tilpner emily symphorien ];
95 };
96}