Willy 565a8722a1 python313Packages.pysmartdl: fix tests
python 3.13 drops `unittest.makeSuite` but provides an easy to use
alternative under `unittest.TestLoader`.
this alternative is old enough to work in all python 3 versions that
nixpkgs contains (currently 9..13), might aswell use it for all of them

even if it really doesn't matter functionally, `pythonAtLeast` would
introduce unnecessary differences between the packages built for
different python versions
2025-05-09 17:06:35 +02:00

54 lines
1.2 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "pysmartdl";
version = "1.3.4";
pyproject = true;
src = fetchFromGitHub {
owner = "iTaybb";
repo = "pySmartDL";
tag = "v${version}";
hash = "sha256-Etyv3xCB1cGozWDsskygwcTHJfC+V5hvqBNQAF8SIMM=";
};
nativeBuildInputs = [ setuptools ];
nativeCheckInputs = [ pytestCheckHook ];
# https://docs.python.org/3/whatsnew/3.13.html#unittest
preCheck = ''
substituteInPlace test/test_pySmartDL.py \
--replace-fail 'unittest.makeSuite(' 'unittest.TestLoader().loadTestsFromTestCase('
'';
disabledTests = [
# touch the network
"test_basic_auth"
"test_custom_headers"
"test_download"
"test_hash"
"test_mirrors"
"test_pause_unpause"
"test_speed_limiting"
"test_stop"
"test_timeout"
"test_unicode"
];
pythonImportsCheck = [ "pySmartDL" ];
meta = with lib; {
homepage = "https://github.com/iTaybb/pySmartDL";
description = "Smart Download Manager for Python";
changelog = "https://github.com/iTaybb/pySmartDL/blob/${src.rev}/ChangeLog.txt";
license = licenses.unlicense;
maintainers = [ ];
};
}