1{ stdenv, buildPythonPackage, fetchFromGitHub, pythonOlder
2, aria2, poetry, pytest, pytestcov, pytest_xdist, responses
3, asciimatics, loguru, requests, setuptools, websocket_client
4, isPy38
5}:
6
7buildPythonPackage rec {
8 pname = "aria2p";
9 version = "0.7.0";
10 format = "pyproject";
11 disabled = pythonOlder "3.6";
12
13 src = fetchFromGitHub {
14 owner = "pawamoy";
15 repo = pname;
16 rev = "v${version}";
17 sha256 = "1inak3y2win58zbzykfzy6xp00f276sqsz69h2nfsd93mpr74wf6";
18 };
19
20 nativeBuildInputs = [ poetry ];
21
22 preBuild = ''
23 export HOME=$TMPDIR
24 '';
25
26 checkInputs = [ aria2 responses pytest pytestcov pytest_xdist ];
27
28 # Tests are not all stable/deterministic,
29 # they rely on actually running an aria2c daemon and communicating with it,
30 # race conditions and deadlocks were observed,
31 # thus the corresponding tests are disabled
32 checkPhase = ''
33 pytest -nauto -k "not test_api and not test_cli and not test_interface"
34 '';
35
36 propagatedBuildInputs = [ asciimatics loguru requests setuptools websocket_client ];
37
38 meta = with stdenv.lib; {
39 homepage = "https://github.com/pawamoy/aria2p";
40 description = "Command-line tool and library to interact with an aria2c daemon process with JSON-RPC";
41 license = licenses.isc;
42 maintainers = with maintainers; [ koral ];
43 broken = isPy38;
44 };
45}