1{
2 stdenv,
3 lib,
4 buildPythonPackage,
5 fetchFromGitHub,
6 pytestCheckHook,
7 chardet,
8 cssselect,
9 lxml,
10 lxml-html-clean,
11 timeout-decorator,
12}:
13
14buildPythonPackage rec {
15 pname = "readability-lxml";
16 version = "0.8.4";
17 format = "setuptools";
18
19 src = fetchFromGitHub {
20 owner = "buriy";
21 repo = "python-readability";
22 rev = "v${version}";
23 hash = "sha256-6A4zpe3GvHHf235Ovr2RT/cJgj7bWasn96yqy73pVgY=";
24 };
25
26 propagatedBuildInputs = [
27 chardet
28 cssselect
29 lxml
30 lxml-html-clean
31 ];
32
33 postPatch = ''
34 substituteInPlace setup.py --replace 'sys.platform == "darwin"' "False"
35 '';
36
37 nativeCheckInputs = [
38 pytestCheckHook
39 timeout-decorator
40 ];
41
42 disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
43 # Test is broken on darwin. Fix in master from https://github.com/buriy/python-readability/pull/178
44 "test_many_repeated_spaces"
45 ];
46
47 meta = with lib; {
48 description = "Fast python port of arc90's readability tool";
49 homepage = "https://github.com/buriy/python-readability";
50 license = licenses.asl20;
51 maintainers = with maintainers; [ siraben ];
52 };
53}