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