Skip to content

Commit

Permalink
pythonPackages.bleach: 1.4.3 -> 1.5.0, closes #21450
Browse files Browse the repository at this point in the history
Unfortunately bleach depends on an older version of html5lib and cannot
use the latest version because the sanitizer module has been moved out.
mozilla/bleach#217
  • Loading branch information
FRidh committed Dec 29, 2016
1 parent 0e400de commit 2f977b4
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions pkgs/top-level/python-packages.nix
Expand Up @@ -2808,17 +2808,39 @@ in {
};
};

# Needed for bleach 1.5.0
html5lib_0_9999999 = self.html5lib.override rec {
name = "html5lib-${version}";
buildInputs = with self; [ nose flake8 ];
propagatedBuildInputs = with self; [ six ];
checkPhase = ''
nosetests
'';

version = "0.9999999";
src = pkgs.fetchurl {
url = "https://github.com/html5lib/html5lib-python/archive/0.9999999.tar.gz";
sha256 = "1s6wdbrjzw5jhyfbskf4nj1i5bjpjqq9f89a7r1rl59rhpwmfhhq";
};
};

bleach = buildPythonPackage rec {
version = "v1.4.3";
name = "bleach-${version}";
pname = "bleach";
version = "1.5.0";
name = "${pname}-${version}";

src = pkgs.fetchurl {
url = "http://github.com/jsocol/bleach/archive/${version}.tar.gz";
sha256 = "0mk8780ilip0m890rapbckngw8k42gca3551kri297pyylr06l5m";
url = "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${name}.tar.gz";
sha256 = "978e758599b54cd3caa2e160d74102879b230ea8dc93871d0783721eef58bc65";
};

buildInputs = with self; [ nose ];
propagatedBuildInputs = with self; [ six html5lib ];
buildInputs = with self; [ pytest pytestrunner ];
propagatedBuildInputs = with self; [ six html5lib_0_9999999 ];

postPatch = ''
substituteInPlace setup.py --replace "==3.0.3" ""
substituteInPlace setup.py --replace ">=0.999,!=0.9999,!=0.99999,<0.99999999" ""
'';

meta = {
description = "An easy, HTML5, whitelisting HTML sanitizer";
Expand Down

0 comments on commit 2f977b4

Please sign in to comment.