1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6
7 # build-system
8 hatchling,
9
10 # dependencies
11 wcwidth,
12
13 # tests
14 pytestCheckHook,
15 versionCheckHook,
16}:
17
18buildPythonPackage rec {
19 pname = "ftfy";
20 version = "6.3.1";
21 pyproject = true;
22
23 disabled = pythonOlder "3.9";
24
25 src = fetchFromGitHub {
26 owner = "rspeer";
27 repo = "python-ftfy";
28 tag = "v${version}";
29 hash = "sha256-TmwDJeUDcF+uOB2X5tMmnf9liCI9rP6dYJVmJoaqszo=";
30 };
31
32 build-system = [ hatchling ];
33
34 dependencies = [ wcwidth ];
35
36 pythonImportsCheck = [ "ftfy" ];
37
38 nativeCheckInputs = [
39 versionCheckHook
40 pytestCheckHook
41 ];
42
43 preCheck = ''
44 export PATH=$out/bin:$PATH
45 '';
46
47 meta = with lib; {
48 changelog = "https://github.com/rspeer/python-ftfy/blob/${src.rev}/CHANGELOG.md";
49 description = "Given Unicode text, make its representation consistent and possibly less broken";
50 mainProgram = "ftfy";
51 homepage = "https://github.com/LuminosoInsight/python-ftfy";
52 license = licenses.asl20;
53 maintainers = with maintainers; [ aborsu ];
54 };
55}