mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-23 06:03:40 +00:00
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
44 lines
1.3 KiB
Nix
44 lines
1.3 KiB
Nix
{ lib, stdenv, buildPythonPackage, fetchFromGitHub, pythonOlder
|
|
, aria2, poetry, pytest, pytestcov, pytest_xdist, responses
|
|
, asciimatics, loguru, requests, setuptools, websocket_client
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "aria2p";
|
|
version = "0.9.1";
|
|
format = "pyproject";
|
|
disabled = pythonOlder "3.6";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "pawamoy";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "1s4kad6jnfz9p64gkqclkfq2x2bn8dbc0hyr86d1545bgn7pz672";
|
|
};
|
|
|
|
nativeBuildInputs = [ poetry ];
|
|
|
|
preBuild = ''
|
|
export HOME=$TMPDIR
|
|
'';
|
|
|
|
checkInputs = [ aria2 responses pytest pytestcov pytest_xdist ];
|
|
|
|
# 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"
|
|
'';
|
|
|
|
propagatedBuildInputs = [ asciimatics loguru requests setuptools websocket_client ];
|
|
|
|
meta = with lib; {
|
|
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 ];
|
|
};
|
|
}
|