about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorRobert Schütz <nix@dotlambda.de>2022-11-28 19:53:16 -0800
committerRobert Schütz <github@dotlambda.de>2022-11-29 18:02:03 -0800
commitbb53b9562436ae0d2afdec419a54ec89288d25f9 (patch)
treeee8c5164886fb575d1d2a518173a20942606fed1 /pkgs
parent75115a0f7237cbd48074e0677318b41965cfeaf6 (diff)
python310Packages.aria2p: 0.9.1 -> 0.11.2
https://github.com/pawamoy/aria2p/blob/0.11.2/CHANGELOG.md
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/python-modules/aria2p/default.nix75
1 files changed, 58 insertions, 17 deletions
diff --git a/pkgs/development/python-modules/aria2p/default.nix b/pkgs/development/python-modules/aria2p/default.nix
index 2a7e6cb0df956..2663f0c9d54e3 100644
--- a/pkgs/development/python-modules/aria2p/default.nix
+++ b/pkgs/development/python-modules/aria2p/default.nix
@@ -1,41 +1,82 @@
-{ 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 ];