nixpkgs/pkgs/development/python-modules/bleach/default.nix

52 lines
1.4 KiB
Nix
Raw Normal View History

2018-01-07 13:01:38 +03:00
{ lib
, buildPythonPackage
, fetchPypi
, pytest
, pytestrunner
, six
, html5lib
, setuptools
2018-01-07 13:01:38 +03:00
}:
buildPythonPackage rec {
pname = "bleach";
2019-02-14 10:37:12 +03:00
version = "3.1.0";
2018-01-07 13:01:38 +03:00
src = fetchPypi {
inherit pname version;
2019-02-14 10:37:12 +03:00
sha256 = "3fdf7f77adcf649c9911387df51254b813185e32b2c6619f690b593a617e19fa";
2018-01-07 13:01:38 +03:00
};
checkInputs = [ pytest pytestrunner ];
propagatedBuildInputs = [ six html5lib setuptools ];
2018-01-07 13:01:38 +03:00
postPatch = ''
substituteInPlace setup.py --replace ",<3dev" ""
'';
2019-08-18 11:54:46 +03:00
# Disable a test
# https://github.com/mozilla/bleach/issues/467
checkPhase = ''
pytest -k "not test_only_text_is_cleaned"
'';
2018-01-07 13:01:38 +03:00
meta = {
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 = lib.licenses.asl20;
maintainers = with lib.maintainers; [ prikhi ];
};
2018-03-17 17:42:09 +03:00
}