summary refs log tree commit diff
path: root/pkgs/development/python-modules/html-sanitizer/default.nix
blob: 111d7e00d1b2cb45872f20508181421754f1a799 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{ lib
, buildPythonPackage
, fetchFromGitHub
, lxml
, beautifulsoup4
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "html-sanitizer";
  version = "1.9.3";

  src = fetchFromGitHub {
    owner = "matthiask";
    repo = pname;
    rev = version;
    sha256 = "sha256-1JSdi1PFM+N+UuEPfgWkOZw8S2PZ4ntadU0wnVJNnjw=";
  };

  propagatedBuildInputs = [
    lxml
    beautifulsoup4
  ];

  checkInputs = [
    pytestCheckHook
  ];

  pytestFlagsArray = [
    "html_sanitizer/tests.py"
  ];

  disabledTests = [
    "test_billion_laughs"
  ];

  pythonImportsCheck = [
    "html_sanitizer"
  ];

  meta = with lib; {
    description = "Allowlist-based and very opinionated HTML sanitizer";
    homepage = "https://github.com/matthiask/html-sanitizer";
    license = with licenses; [ bsd3 ];
    maintainers = with maintainers; [ fab ];
  };
}