linkchecker: modernize, add PDF support

This commit is contained in:
Petr Zahradnik 2025-08-07 11:58:42 +02:00 committed by Peter Hoeg
parent 19f5098f8b
commit c02976ad5f

View File

@ -1,11 +1,12 @@
{ {
python3Packages,
lib, lib,
fetchFromGitHub, fetchFromGitHub,
python3,
gettext, gettext,
pdfSupport ? true,
}: }:
python3.pkgs.buildPythonApplication rec { python3Packages.buildPythonApplication rec {
pname = "linkchecker"; pname = "linkchecker";
version = "10.6.0"; version = "10.6.0";
pyproject = true; pyproject = true;
@ -19,31 +20,36 @@ python3.pkgs.buildPythonApplication rec {
nativeBuildInputs = [ gettext ]; nativeBuildInputs = [ gettext ];
build-system = with python3.pkgs; [ build-system = with python3Packages; [
hatchling hatchling
hatch-vcs hatch-vcs
polib # translations polib # translations
]; ];
dependencies = with python3.pkgs; [ dependencies =
argcomplete with python3Packages;
beautifulsoup4 [
dnspython argcomplete
requests beautifulsoup4
]; dnspython
requests
]
++ lib.optional pdfSupport pdfminer-six;
nativeCheckInputs = with python3.pkgs; [ nativeCheckInputs = with python3Packages; [
pyopenssl pyopenssl
parameterized parameterized
pytestCheckHook pytestCheckHook
pyftpdlib
]; ];
# Needed for tests to be able to create a ~/.local/share/linkchecker/plugins directory
preCheck = ''
export HOME=$(mktemp -d)
'';
disabledTests = [ disabledTests = [
"TestLoginUrl"
"test_timeit2" # flakey, and depends sleep being precise to the milisecond "test_timeit2" # flakey, and depends sleep being precise to the milisecond
"test_internet" # uses network, fails on Darwin (not sure why it doesn't fail on linux)
"test_markdown" # uses sys.version_info for conditional testing
"test_itms_services" # uses sys.version_info for conditional testing
]; ];
__darwinAllowLocalNetworking = true; __darwinAllowLocalNetworking = true;