1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 aiohttp,
6 backoff,
7 yarl,
8 aresponses,
9 pytest-asyncio,
10 pytestCheckHook,
11}:
12
13buildPythonPackage rec {
14 pname = "aiomodernforms";
15 version = "0.1.8";
16 format = "setuptools";
17
18 src = fetchFromGitHub {
19 owner = "wonderslug";
20 repo = "aiomodernforms";
21 rev = "v${version}";
22 hash = "sha256-Vx51WBjjNPIfLlwMnAuwHnGNljhnjKkU0tWB9M9rjsw=";
23 };
24
25 postPatch = ''
26 substituteInPlace aiomodernforms/modernforms.py --replace-fail \
27 "with async_timeout.timeout(self._request_timeout):" \
28 "async with async_timeout.timeout(self._request_timeout):"
29 '';
30
31 propagatedBuildInputs = [
32 aiohttp
33 backoff
34 yarl
35 ];
36
37 nativeCheckInputs = [
38 aresponses
39 pytest-asyncio
40 pytestCheckHook
41 ];
42
43 disabledTests = [
44 # https://github.com/wonderslug/aiomodernforms/issues/273
45 "test_connection_error"
46 "test_empty_response"
47 ];
48
49 pythonImportsCheck = [ "aiomodernforms" ];
50
51 meta = with lib; {
52 description = "Asynchronous Python client for Modern Forms fans";
53 homepage = "https://github.com/wonderslug/aiomodernforms";
54 license = licenses.mit;
55 maintainers = with maintainers; [ dotlambda ];
56 };
57}