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