doc: extract manpage-urls test into its own package

This commit is contained in:
Philip Taron 2024-07-26 11:28:06 -07:00
parent 2266280af7
commit 8bb7777aee
No known key found for this signature in database
2 changed files with 32 additions and 21 deletions

View File

@ -93,26 +93,6 @@ in pkgs.stdenv.mkDerivation {
passthru = {
inherit pythonInterpreterTable;
tests.manpage-urls = with pkgs; testers.invalidateFetcherByDrvHash
({ name ? "manual_check-manpage-urls"
, script
, urlsFile
}: runCommand name {
nativeBuildInputs = [
cacert
(python3.withPackages (p: with p; [
aiohttp
rich
structlog
]))
];
outputHash = "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU="; # Empty output
} ''
python3 ${script} ${urlsFile}
touch $out
'') {
script = ./tests/manpage-urls.py;
urlsFile = ./manpage-urls.json;
};
tests.manpage-urls = callPackage ./tests/manpage-urls.nix { };
};
}

View File

@ -0,0 +1,31 @@
{
lib,
runCommand,
invalidateFetcherByDrvHash,
cacert,
python3,
}:
invalidateFetcherByDrvHash (
{
name ? "manual_check-manpage-urls",
script ? ./manpage-urls.py,
urlsFile ? ../manpage-urls.json,
}:
runCommand name
{
nativeBuildInputs = [
cacert
(python3.withPackages (p: [
p.aiohttp
p.rich
p.structlog
]))
];
outputHash = "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU="; # Empty output
}
''
python3 ${script} ${urlsFile}
touch $out
''
) { }