about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2022-11-22 11:27:19 +0800
committerPeter Hoeg <peter@hoeg.com>2022-11-25 12:36:30 +0800
commit7b3a88ed2694394be889fc1ea40bef5cfaff70c9 (patch)
tree4077d7fae22c5fba8dde4a9bd53c1dd5f48eb990
parent4c75a5ac25250b3123457d21a22784ecd0c1c6cf (diff)
linkchecker: 10.0.1 -> 10.2.0
-rw-r--r--pkgs/tools/networking/linkchecker/default.nix50
1 files changed, 26 insertions, 24 deletions
diff --git a/pkgs/tools/networking/linkchecker/default.nix b/pkgs/tools/networking/linkchecker/default.nix
index 3cb5ecb015307..1facde5bc792d 100644
--- a/pkgs/tools/networking/linkchecker/default.nix
+++ b/pkgs/tools/networking/linkchecker/default.nix
@@ -1,54 +1,56 @@
 { stdenv, lib, fetchFromGitHub, python3Packages, gettext }:
 
-with python3Packages;
+let
+  pypkgs = python3Packages;
 
-buildPythonApplication rec {
+in
+pypkgs.buildPythonApplication rec {
   pname = "linkchecker";
-  version = "10.0.1";
+  version = "10.2.0";
+  format = "pyproject";
+
+  disabled = pypkgs.pythonOlder "3.7";
 
   src = fetchFromGitHub {
     owner = pname;
     repo = pname;
     rev = "v" + version;
-    sha256 = "sha256-OOssHbX9nTCURpMKIy+95ZTvahuUAabLUhPnRp3xpN4=";
+    hash = "sha256-wMiKS14fX5mkY1OwxQPFKm7i4WMFQKg3tdZZqD0g0Rw=";
   };
 
+  SETUPTOOLS_SCM_PRETEND_VERSION = version;
+
   nativeBuildInputs = [ gettext ];
 
-  propagatedBuildInputs = [
-    configargparse
+  propagatedBuildInputs = with pypkgs; [
     argcomplete
     beautifulsoup4
-    pyopenssl
+    configargparse
     dnspython
-    pyxdg
+    hatch-vcs
+    hatchling
+    pyopenssl
     requests
   ];
 
-  checkInputs = [
+  checkInputs = with pypkgs; [
     parameterized
     pytest
   ];
 
-  postPatch = ''
-    sed -i 's/^requests.*$/requests>=2.2/' requirements.txt
-    sed -i "s/'request.*'/'requests >= 2.2'/" setup.py
-  '';
-
   # test_timeit2 is flakey, and depends sleep being precise to the milisecond
-  checkPhase = ''
-    ${lib.optionalString stdenv.isDarwin ''
-      # network tests fails on darwin
-      rm tests/test_network.py tests/checker/test_http*.py tests/checker/test_content_allows_robots.py tests/checker/test_noproxy.py
-    ''}
-      pytest --ignore=tests/checker/{test_telnet,telnetserver}.py \
-        -k 'not TestLoginUrl and not test_timeit2'
+  checkPhase = lib.optionalString stdenv.isDarwin ''
+    # network tests fails on darwin
+    rm tests/test_network.py tests/checker/test_http*.py tests/checker/test_content_allows_robots.py tests/checker/test_noproxy.py
+  '' + ''
+    pytest --ignore=tests/checker/{test_telnet,telnetserver}.py \
+      -k 'not TestLoginUrl and not test_timeit2'
   '';
 
-  meta = {
+  meta = with lib; {
     description = "Check websites for broken links";
     homepage = "https://linkcheck.github.io/linkchecker/";
-    license = lib.licenses.gpl2;
-    maintainers = with lib.maintainers; [ peterhoeg tweber ];
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ peterhoeg tweber ];
   };
 }