1{ stdenv
2, buildPythonPackage
3, fetchPypi
4, html5lib
5, wcwidth
6, nose
7}:
8
9buildPythonPackage rec {
10 pname = "ftfy";
11
12 version = "4.4.3";
13 # ftfy v5 only supports python3. Since at the moment the only
14 # packages that use ftfy are spacy and textacy which both support
15 # python 2 and 3, they have pinned ftfy to the v4 branch.
16 # I propose to stick to v4 until another package requires v5.
17 # At that point we can make a ftfy_v4 package.
18
19 src = fetchPypi {
20 inherit pname version;
21 sha256 = "152xdb56rhs1q4r0ck1n557sbphw7zq18r75a7kkd159ckdnc01w";
22 };
23
24 propagatedBuildInputs = [ html5lib wcwidth ];
25
26 checkInputs = [
27 nose
28 ];
29
30 checkPhase = ''
31 nosetests -v tests
32 '';
33
34 # Several tests fail with
35 # FileNotFoundError: [Errno 2] No such file or directory: 'ftfy'
36 doCheck = false;
37
38 meta = with stdenv.lib; {
39 description = "Given Unicode text, make its representation consistent and possibly less broken.";
40 homepage = https://github.com/LuminosoInsight/python-ftfy/tree/master/tests;
41 license = licenses.mit;
42 maintainers = with maintainers; [ sdll aborsu ];
43 };
44}