1{
2 lib,
3 buildPythonPackage,
4 cargo,
5 fetchFromGitHub,
6 pytestCheckHook,
7 pythonOlder,
8 rustc,
9 rustPlatform,
10 unicodecsv,
11}:
12
13buildPythonPackage rec {
14 pname = "jellyfish";
15 version = "1.1.2";
16 pyproject = true;
17
18 disabled = pythonOlder "3.11";
19
20 src = fetchFromGitHub {
21 owner = "jamesturk";
22 repo = "jellyfish";
23 rev = version;
24 hash = "sha256-xInjoTXYgZuHyvyKm+N4PAwHozE5BOkxoYhRzZnPs3Q=";
25 };
26
27 cargoDeps = rustPlatform.importCargoLock {
28 lockFile = ./Cargo.lock;
29 };
30
31 postPatch = ''
32 ln -s ${./Cargo.lock} Cargo.lock
33 '';
34
35 build-system = [
36 cargo
37 rustPlatform.cargoSetupHook
38 rustPlatform.maturinBuildHook
39 rustc
40 ];
41
42 nativeCheckInputs = [
43 pytestCheckHook
44 unicodecsv
45 ];
46
47 pythonImportsCheck = [ "jellyfish" ];
48
49 meta = {
50 description = "A python library for doing approximate and phonetic matching of strings";
51 homepage = "https://github.com/jamesturk/jellyfish";
52 changelog = "https://github.com/jamesturk/jellyfish/releases/tag/v${version}";
53 license = lib.licenses.mit;
54 maintainers = with lib.maintainers; [ koral ];
55 };
56}