depot/third_party/nixpkgs/pkgs/tools/networking/linkchecker/default.nix
Default email 849ee4d900 Project import generated by Copybara.
GitOrigin-RevId: 9e377a6ce42dccd9b624ae4ce8f978dc892ba0e2
2021-04-08 18:26:57 +02:00

54 lines
1.3 KiB
Nix

{ stdenv, lib, fetchFromGitHub, python3Packages, gettext }:
with python3Packages;
buildPythonApplication rec {
pname = "linkchecker";
version = "10.0.0";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "v" + version;
sha256 = "sha256-gcaamRxGn124LZ8rU+WzjRookU3akDO0ZyzI7/S6kFA=";
};
nativeBuildInputs = [ gettext ];
propagatedBuildInputs = [
ConfigArgParse
argcomplete
beautifulsoup4
pyopenssl
dnspython
pyxdg
requests
];
checkInputs = [
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'
'';
meta = {
description = "Check websites for broken links";
homepage = "https://linkcheck.github.io/linkchecker/";
license = lib.licenses.gpl2;
maintainers = with lib.maintainers; [ peterhoeg tweber ];
};
}