From c02976ad5fbd7c2ba6ddb251fcb45543247bb90c Mon Sep 17 00:00:00 2001 From: Petr Zahradnik Date: Thu, 7 Aug 2025 11:58:42 +0200 Subject: [PATCH] linkchecker: modernize, add PDF support --- pkgs/by-name/li/linkchecker/package.nix | 34 +++++++++++++++---------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/pkgs/by-name/li/linkchecker/package.nix b/pkgs/by-name/li/linkchecker/package.nix index 1395dfba23ba..e94747d4eaa3 100644 --- a/pkgs/by-name/li/linkchecker/package.nix +++ b/pkgs/by-name/li/linkchecker/package.nix @@ -1,11 +1,12 @@ { + python3Packages, lib, fetchFromGitHub, - python3, gettext, + pdfSupport ? true, }: -python3.pkgs.buildPythonApplication rec { +python3Packages.buildPythonApplication rec { pname = "linkchecker"; version = "10.6.0"; pyproject = true; @@ -19,31 +20,36 @@ python3.pkgs.buildPythonApplication rec { nativeBuildInputs = [ gettext ]; - build-system = with python3.pkgs; [ + build-system = with python3Packages; [ hatchling hatch-vcs polib # translations ]; - dependencies = with python3.pkgs; [ - argcomplete - beautifulsoup4 - dnspython - requests - ]; + dependencies = + with python3Packages; + [ + argcomplete + beautifulsoup4 + dnspython + requests + ] + ++ lib.optional pdfSupport pdfminer-six; - nativeCheckInputs = with python3.pkgs; [ + nativeCheckInputs = with python3Packages; [ pyopenssl parameterized pytestCheckHook + pyftpdlib ]; + # Needed for tests to be able to create a ~/.local/share/linkchecker/plugins directory + preCheck = '' + export HOME=$(mktemp -d) + ''; + disabledTests = [ - "TestLoginUrl" "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;