about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/bleach/default.nix
blob: 901eb76417ff7b0594fb34615651b36481b7cac4 (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{ lib
, buildPythonPackage
, fetchPypi
, pytestCheckHook
, six
, html5lib
, setuptools
, tinycss2
, packaging
, pythonOlder
, webencodings
}:

buildPythonPackage rec {
  pname = "bleach";
  version = "6.0.0";
  format = "setuptools";
  disabled = pythonOlder "3.7";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-GhqFwVleB9jbFMXwnwnmQzUCxRxZWXDtwJBVHw25lBQ=";
  };

  propagatedBuildInputs = [
    html5lib
    packaging
    setuptools
    six
    webencodings
  ];

  passthru.optional-dependencies = {
    css = [
      tinycss2
    ];
  };

  nativeCheckInputs = [
    pytestCheckHook
  ];

  disabledTests = [
    # Disable network tests
    "protocols"
  ];

  pythonImportsCheck = [
    "bleach"
  ];

  meta = with lib; {
    description = "An easy, HTML5, whitelisting HTML sanitizer";
    longDescription = ''
      Bleach is an HTML sanitizing library that escapes or strips markup and
      attributes based on a white list. Bleach can also linkify text safely,
      applying filters that Django's urlize filter cannot, and optionally
      setting rel attributes, even on links already in the text.

      Bleach is intended for sanitizing text from untrusted sources. If you
      find yourself jumping through hoops to allow your site administrators
      to do lots of things, you're probably outside the use cases. Either
      trust those users, or don't.
    '';
    homepage = "https://github.com/mozilla/bleach";
    downloadPage = "https://github.com/mozilla/bleach/releases";
    license = licenses.asl20;
    maintainers = with maintainers; [ prikhi ];
  };
}