1{ stdenv
2, buildPythonPackage
3, fetchPypi
4, html5lib
5, wcwidth
6, nose
7, python
8, isPy3k
9}:
10buildPythonPackage rec {
11 name = "${pname}-${version}";
12 pname = "ftfy";
13 # latest is 5.1.1, buy spaCy requires 4.4.3
14 version = "5.3.0";
15
16 src = fetchPypi {
17 inherit pname version;
18 sha256 = "0ba702d5138f9b35df32b55920c9466208608108f1f3d5de1a68c17e3d68cb7f";
19 };
20
21 propagatedBuildInputs = [ html5lib wcwidth];
22
23 checkInputs = [
24 nose
25 ];
26
27 checkPhase = ''
28 nosetests -v tests
29 '';
30
31 # Several tests fail with
32 # FileNotFoundError: [Errno 2] No such file or directory: 'ftfy'
33 doCheck = false;
34
35 # "this version of ftfy is no longer written for Python 2"
36 disabled = !isPy3k;
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 ];
43 };
44}