diff options
author | Frederik Rietdijk <freddyrietdijk@fridh.nl> | 2016-10-12 10:21:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-12 10:21:29 +0200 |
commit | f3c6236eb429da31e24b26b5c6bc848602d90267 (patch) | |
tree | 1073f4a51076610ccaf402824b50da1bb7d28dcc /pkgs/tools/networking | |
parent | e207ba7d6acdbba67c996f675547ea69cb4e9b9d (diff) | |
parent | b120ef422cfc888e93b426084e071c184fd37b3c (diff) | |
download | nixlib-f3c6236eb429da31e24b26b5c6bc848602d90267.tar nixlib-f3c6236eb429da31e24b26b5c6bc848602d90267.tar.gz nixlib-f3c6236eb429da31e24b26b5c6bc848602d90267.tar.bz2 nixlib-f3c6236eb429da31e24b26b5c6bc848602d90267.tar.lz nixlib-f3c6236eb429da31e24b26b5c6bc848602d90267.tar.xz nixlib-f3c6236eb429da31e24b26b5c6bc848602d90267.tar.zst nixlib-f3c6236eb429da31e24b26b5c6bc848602d90267.zip |
Merge pull request #19442 from peterhoeg/lc
linkchecker: make it work with newer requests2
Diffstat (limited to 'pkgs/tools/networking')
-rw-r--r-- | pkgs/tools/networking/linkchecker/default.nix | 16 | ||||
-rw-r--r-- | pkgs/tools/networking/linkchecker/no-version-check.patch | 14 |
2 files changed, 26 insertions, 4 deletions
diff --git a/pkgs/tools/networking/linkchecker/default.nix b/pkgs/tools/networking/linkchecker/default.nix index 79566f129019..59699076a3ac 100644 --- a/pkgs/tools/networking/linkchecker/default.nix +++ b/pkgs/tools/networking/linkchecker/default.nix @@ -1,26 +1,34 @@ -{ stdenv, lib, fetchurl, python2Packages }: +{ stdenv, lib, fetchurl, python2Packages, gettext }: python2Packages.buildPythonApplication rec { name = "LinkChecker-${version}"; version = "9.3"; - # LinkChecker 9.3 only works with requests 2.9.x - propagatedBuildInputs = with python2Packages ; [ requests2 ]; + buildInputs = with python2Packages ; [ pytest ]; + propagatedBuildInputs = with python2Packages ; [ requests2 ] ++ [ gettext ]; src = fetchurl { url = "mirror://pypi/L/LinkChecker/${name}.tar.gz"; sha256 = "0v8pavf0bx33xnz1kwflv0r7lxxwj7vg3syxhy2wzza0wh6sc2pf"; }; - # upstream refuses to support ignoring robots.txt + # 1. upstream refuses to support ignoring robots.txt + # 2. work around requests2 version detection - can be dropped >v9.3 patches = [ ./add-no-robots-flag.patch + ./no-version-check.patch ]; postInstall = '' rm $out/bin/linkchecker-gui ''; + checkPhase = '' + # the mime test fails for me... + rm tests/test_mimeutil.py + make test PYTESTOPTS="--tb=short" TESTS="tests/test_*.py tests/logger/test_*.py" + ''; + meta = { description = "Check websites for broken links"; homepage = "https://wummel.github.io/linkchecker/"; diff --git a/pkgs/tools/networking/linkchecker/no-version-check.patch b/pkgs/tools/networking/linkchecker/no-version-check.patch new file mode 100644 index 000000000000..49b674f37359 --- /dev/null +++ b/pkgs/tools/networking/linkchecker/no-version-check.patch @@ -0,0 +1,14 @@ +diff --git a/linkcheck/__init__.py b/linkcheck/__init__.py +--- a/linkcheck/__init__.py 2014-07-16 13:34:58.000000000 +0800 ++++ b/linkcheck/__init__.py 2016-10-11 10:42:08.914085950 +0800 +@@ -26,8 +26,8 @@ + sys.version_info < (2, 7, 2, 'final', 0)): + raise SystemExit("This program requires Python 2.7.2 or later.") + import requests +-if requests.__version__ <= '2.2.0': +- raise SystemExit("This program requires Python requests 2.2.0 or later.") ++#if requests.__version__ <= '2.2.0': ++# raise SystemExit("This program requires Python requests 2.2.0 or later.") + + import os + # add the custom linkcheck_dns directory to sys.path |