2021-01-25 08:26:54 +00:00
|
|
|
{ lib, buildPythonPackage, fetchFromGitHub, pythonOlder
|
2021-07-20 22:08:56 +01:00
|
|
|
, aria2, poetry, pytest, pytest-cov, pytest-xdist, responses
|
2021-06-15 12:12:45 +01:00
|
|
|
, asciimatics, loguru, requests, setuptools, websocket-client
|
2020-01-18 13:25:36 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "aria2p";
|
2020-10-16 12:35:37 +01:00
|
|
|
version = "0.9.1";
|
2020-01-18 13:25:36 +00:00
|
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pawamoy";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2020-10-16 12:35:37 +01:00
|
|
|
sha256 = "1s4kad6jnfz9p64gkqclkfq2x2bn8dbc0hyr86d1545bgn7pz672";
|
2020-01-18 13:25:36 +00:00
|
|
|
};
|
2020-08-25 03:07:09 +01:00
|
|
|
|
2020-01-18 13:25:36 +00:00
|
|
|
nativeBuildInputs = [ poetry ];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
|
|
|
|
2021-07-20 22:08:56 +01:00
|
|
|
checkInputs = [ aria2 responses pytest pytest-cov pytest-xdist ];
|
2020-01-18 13:25:36 +00:00
|
|
|
|
|
|
|
# Tests are not all stable/deterministic,
|
|
|
|
# they rely on actually running an aria2c daemon and communicating with it,
|
|
|
|
# race conditions and deadlocks were observed,
|
|
|
|
# thus the corresponding tests are disabled
|
|
|
|
checkPhase = ''
|
|
|
|
pytest -nauto -k "not test_api and not test_cli and not test_interface"
|
|
|
|
'';
|
|
|
|
|
2021-06-15 12:12:45 +01:00
|
|
|
propagatedBuildInputs = [ asciimatics loguru requests setuptools websocket-client ];
|
2020-01-18 13:25:36 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-01-18 13:25:36 +00:00
|
|
|
homepage = "https://github.com/pawamoy/aria2p";
|
|
|
|
description = "Command-line tool and library to interact with an aria2c daemon process with JSON-RPC";
|
|
|
|
license = licenses.isc;
|
|
|
|
maintainers = with maintainers; [ koral ];
|
|
|
|
};
|
|
|
|
}
|