1{ stdenv
2, buildPythonPackage
3, isPy3k
4, fetchPypi
5, html5lib
6, wcwidth
7, setuptools
8, pytest
9}:
10
11buildPythonPackage rec {
12 pname = "ftfy";
13 version = "5.8";
14
15 disabled = !isPy3k;
16
17 src = fetchPypi {
18 inherit pname version;
19 sha256 = "081p5z20dirrf1i3nshylc31qd5mbxibjc7gzj8x4isbiizpdisi";
20 };
21
22 propagatedBuildInputs = [
23 html5lib
24 wcwidth
25 setuptools
26 ];
27
28 checkInputs = [
29 pytest
30 ];
31
32 # We suffix PATH like this because the tests want the ftfy executable
33 checkPhase = ''
34 PATH=$out/bin:$PATH pytest
35 '';
36
37 meta = with stdenv.lib; {
38 description = "Given Unicode text, make its representation consistent and possibly less broken";
39 homepage = "https://github.com/LuminosoInsight/python-ftfy";
40 license = licenses.mit;
41 maintainers = with maintainers; [ sdll aborsu ];
42 };
43}