1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 flit-core,
6 fzf,
7 packaging,
8 pytestCheckHook,
9 pythonOlder,
10 setuptools,
11}:
12
13buildPythonPackage rec {
14 pname = "iterfzf";
15 version = "1.8.0.62.0";
16 pyproject = true;
17
18 disabled = pythonOlder "3.8";
19
20 src = fetchFromGitHub {
21 owner = "dahlia";
22 repo = "iterfzf";
23 tag = version;
24 hash = "sha256-eLgF+9p+sqxWR1VkSoeL0NPDMamzUYbql4gMeG8fyNY=";
25 };
26
27 postPatch = ''
28 substituteInPlace pyproject.toml \
29 --replace-fail 'dynamic = ["version"]' 'version = "${version}"' \
30 --replace-fail 'backend-path = ["."]' '# backend-path = ["."]' \
31 --replace-fail 'build-backend = "build_dist"' '# build-backend = "build_dist"'
32
33 substituteInPlace iterfzf/test_iterfzf.py \
34 --replace-fail 'executable="fzf"' 'executable="${fzf}/bin/fzf"'
35 '';
36
37 build-system = [
38 flit-core
39 setuptools
40 packaging
41 ];
42
43 dependencies = [ fzf ];
44
45 nativeCheckInputs = [ pytestCheckHook ];
46
47 disabledTests = [
48 # AttributeError
49 "test_no_query"
50 "test_select_one_ambiguous"
51 "test_supports_color_kwarg"
52 ];
53
54 pythonImportsCheck = [ "iterfzf" ];
55
56 meta = {
57 description = "Pythonic interface to fzf, a CLI fuzzy finder";
58 homepage = "https://github.com/dahlia/iterfzf";
59 changelog = "https://github.com/dahlia/iterfzf/releases/tag/${version}";
60 license = lib.licenses.gpl3Only;
61 maintainers = with lib.maintainers; [ fab ];
62 platforms = lib.platforms.unix;
63 };
64}