2020-09-25 04:45:31 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, python3Packages, gettext }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
with python3Packages;
|
|
|
|
|
|
|
|
buildPythonApplication rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "linkchecker";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "10.0.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
2021-02-05 17:12:51 +00:00
|
|
|
rev = "v" + version;
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "sha256-OOssHbX9nTCURpMKIy+95ZTvahuUAabLUhPnRp3xpN4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ gettext ];
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
propagatedBuildInputs = [
|
2021-07-24 12:14:16 +00:00
|
|
|
configargparse
|
2020-04-24 23:36:52 +00:00
|
|
|
argcomplete
|
2020-09-25 04:45:31 +00:00
|
|
|
beautifulsoup4
|
2021-04-08 16:26:57 +00:00
|
|
|
pyopenssl
|
2020-04-24 23:36:52 +00:00
|
|
|
dnspython
|
|
|
|
pyxdg
|
|
|
|
requests
|
|
|
|
];
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
checkInputs = [
|
2020-04-24 23:36:52 +00:00
|
|
|
parameterized
|
|
|
|
pytest
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i 's/^requests.*$/requests>=2.2/' requirements.txt
|
|
|
|
sed -i "s/'request.*'/'requests >= 2.2'/" setup.py
|
|
|
|
'';
|
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
# test_timeit2 is flakey, and depends sleep being precise to the milisecond
|
2020-04-24 23:36:52 +00:00
|
|
|
checkPhase = ''
|
|
|
|
${lib.optionalString stdenv.isDarwin ''
|
|
|
|
# network tests fails on darwin
|
2020-12-25 13:55:36 +00:00
|
|
|
rm tests/test_network.py tests/checker/test_http*.py tests/checker/test_content_allows_robots.py tests/checker/test_noproxy.py
|
2020-04-24 23:36:52 +00:00
|
|
|
''}
|
2020-10-07 09:15:18 +00:00
|
|
|
pytest --ignore=tests/checker/{test_telnet,telnetserver}.py \
|
|
|
|
-k 'not TestLoginUrl and not test_timeit2'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Check websites for broken links";
|
|
|
|
homepage = "https://linkcheck.github.io/linkchecker/";
|
|
|
|
license = lib.licenses.gpl2;
|
|
|
|
maintainers = with lib.maintainers; [ peterhoeg tweber ];
|
|
|
|
};
|
|
|
|
}
|