Commit bb53b956 authored by Robert Schütz's avatar Robert Schütz Committed by Robert Schütz
Browse files

python310Packages.aria2p: 0.9.1 -> 0.11.2

parent 75115a0f
Loading
Loading
Loading
Loading
+58 −17
Original line number Diff line number Diff line
{ lib, buildPythonPackage, fetchFromGitHub, pythonOlder
, aria2, poetry, pytest, pytest-cov, pytest-xdist, responses
, asciimatics, loguru, requests, setuptools, websocket-client
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, pdm-pep517
, appdirs
, loguru
, requests
, setuptools
, toml
, websocket-client
, asciimatics
, pyperclip
, aria2
, fastapi
, pytest-xdist
, pytestCheckHook
, responses
, uvicorn
}:

buildPythonPackage rec {
  pname = "aria2p";
  version = "0.9.1";
  version = "0.11.2";
  format = "pyproject";
  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "pawamoy";
    repo = pname;
    rev = "v${version}";
    sha256 = "1s4kad6jnfz9p64gkqclkfq2x2bn8dbc0hyr86d1545bgn7pz672";
    rev = version;
    hash = "sha256-z74ej6J6Yh1aVsXR5fE+XhoCzCS+zfDxQL8gKFd7tBA=";
  };

  nativeBuildInputs = [ poetry ];
  nativeBuildInputs = [
    pdm-pep517
  ];

  preBuild = ''
  propagatedBuildInputs = [
    appdirs
    loguru
    requests
    setuptools # for pkg_resources
    toml
    websocket-client
  ];

  passthru.optional-dependencies = {
    tui = [ asciimatics pyperclip ];
  };

  preCheck = ''
    export HOME=$TMPDIR
  '';

  checkInputs = [ aria2 responses pytest pytest-cov pytest-xdist ];
  checkInputs = [
    aria2
    fastapi
    pytest-xdist
    pytestCheckHook
    responses
    uvicorn
  ] ++ passthru.optional-dependencies.tui;

  # 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"
  '';
  disabledTests = [
    # require a running display server
    "test_add_downloads_torrents_and_metalinks"
    "test_add_downloads_uris"
    # require a running aria2 server
    "test_get_files_method"
    "test_pause_subcommand"
    "test_resume_method"
  ];

  propagatedBuildInputs = [ asciimatics loguru requests setuptools websocket-client ];
  pythonImportsCheck = [ "aria2p" ];

  meta = with lib; {
    homepage = "https://github.com/pawamoy/aria2p";
    changelog = "https://github.com/pawamoy/aria2p/blob/${src.rev}/CHANGELOG.md";
    description = "Command-line tool and library to interact with an aria2c daemon process with JSON-RPC";
    license = licenses.isc;
    maintainers = with maintainers; [ koral ];