2020-08-17 04:48:01 +02:00
|
|
|
{ stdenv, lib, fetchFromGitHub, python3Packages, gettext }:
|
2016-05-26 11:20:30 +02:00
|
|
|
|
2020-08-17 04:48:01 +02:00
|
|
|
with python3Packages;
|
|
|
|
|
|
|
|
buildPythonApplication rec {
|
2019-07-23 10:07:56 +02:00
|
|
|
pname = "linkchecker";
|
2021-01-22 09:02:34 +01:00
|
|
|
version = "10.0.0";
|
2016-05-26 11:20:30 +02:00
|
|
|
|
2018-03-05 16:14:21 +01:00
|
|
|
src = fetchFromGitHub {
|
2019-07-23 10:07:56 +02:00
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
2021-01-22 09:02:34 +01:00
|
|
|
rev = "v" + version;
|
|
|
|
sha256 = "sha256-gcaamRxGn124LZ8rU+WzjRookU3akDO0ZyzI7/S6kFA=";
|
2016-05-26 11:20:30 +02:00
|
|
|
};
|
|
|
|
|
2019-07-23 10:07:56 +02:00
|
|
|
nativeBuildInputs = [ gettext ];
|
2016-05-26 11:20:30 +02:00
|
|
|
|
2020-08-17 04:48:01 +02:00
|
|
|
propagatedBuildInputs = [
|
2021-07-20 23:26:16 +02:00
|
|
|
configargparse
|
2019-07-23 10:07:56 +02:00
|
|
|
argcomplete
|
2020-08-17 04:48:01 +02:00
|
|
|
beautifulsoup4
|
2021-04-05 20:38:06 +02:00
|
|
|
pyopenssl
|
2019-07-23 10:07:56 +02:00
|
|
|
dnspython
|
|
|
|
pyxdg
|
|
|
|
requests
|
|
|
|
];
|
|
|
|
|
2020-08-17 04:48:01 +02:00
|
|
|
checkInputs = [
|
2019-07-23 10:07:56 +02: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 11:20:30 +02:00
|
|
|
'';
|
|
|
|
|
2020-09-29 18:29:20 +02:00
|
|
|
# test_timeit2 is flakey, and depends sleep being precise to the milisecond
|
2016-10-11 05:02:52 +02:00
|
|
|
checkPhase = ''
|
2017-02-26 12:21:24 +01:00
|
|
|
${lib.optionalString stdenv.isDarwin ''
|
2019-07-23 10:07:56 +02:00
|
|
|
# network tests fails on darwin
|
2020-12-08 02:55:13 +01: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 12:21:24 +01:00
|
|
|
''}
|
2020-09-29 18:29:20 +02:00
|
|
|
pytest --ignore=tests/checker/{test_telnet,telnetserver}.py \
|
|
|
|
-k 'not TestLoginUrl and not test_timeit2'
|
2016-10-11 05:02:52 +02:00
|
|
|
'';
|
|
|
|
|
2016-05-26 11:20:30 +02:00
|
|
|
meta = {
|
|
|
|
description = "Check websites for broken links";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://linkcheck.github.io/linkchecker/";
|
2016-05-26 11:20:30 +02:00
|
|
|
license = lib.licenses.gpl2;
|
2018-03-05 16:14:21 +01:00
|
|
|
maintainers = with lib.maintainers; [ peterhoeg tweber ];
|
2016-05-26 11:20:30 +02:00
|
|
|
};
|
|
|
|
}
|