Yueh-Shun Li 624897829b treewide: modernize Python package pytest flags
Use `(enabled|disabled)(TestPaths|TestMarks|Tests)` and `pytestFlags`
instead of the `__structuredAttrs`-incompatible `pytestFlagsArray`.
2025-07-15 03:00:08 +08:00

93 lines
1.5 KiB
Nix

{
lib,
fetchFromGitHub,
installShellFiles,
nix-update-script,
python3Packages,
perl,
ffmpeg,
}:
let
inherit (python3Packages)
buildPythonApplication
setuptools
requests
pysocks
cryptography
pyyaml
pytestCheckHook
mock
requests-mock
;
version = "4.127";
in
buildPythonApplication {
pname = "svtplay-dl";
inherit version;
pyproject = true;
src = fetchFromGitHub {
owner = "spaam";
repo = "svtplay-dl";
rev = version;
hash = "sha256-p+Ncd5J0DEuoU+h2ouPNi0s0XQcGpYXb5n7x0nj1NJ8=";
};
build-system = [ setuptools ];
dependencies = [
requests
pysocks
cryptography
pyyaml
];
nativeBuildInputs = [
# For `pod2man(1)`.
perl
installShellFiles
];
nativeCheckInputs = [
pytestCheckHook
mock
requests-mock
];
pytestFlags = [
"--doctest-modules"
];
enabledTestPaths = [
"lib"
];
postBuild = ''
make svtplay-dl.1
'';
postInstall = ''
installManPage svtplay-dl.1
makeWrapperArgs+=(--prefix PATH : "${lib.makeBinPath [ ffmpeg ]}")
'';
postInstallCheck = ''
$out/bin/svtplay-dl --help > /dev/null
'';
passthru.updateScript = nix-update-script { };
meta = {
homepage = "https://github.com/spaam/svtplay-dl";
description = "Command-line tool to download videos from svtplay.se and other sites";
license = lib.licenses.mit;
platforms = lib.platforms.unix;
mainProgram = "svtplay-dl";
};
}