1{
2 buildPythonPackage,
3 fetchFromGitHub,
4 lib,
5 numpy,
6 pytest-repeat,
7 pytestCheckHook,
8 setuptools,
9 stdenv,
10}:
11
12buildPythonPackage rec {
13 pname = "stringzilla";
14 version = "4.0.15";
15 pyproject = true;
16
17 src = fetchFromGitHub {
18 owner = "ashvardanian";
19 repo = "stringzilla";
20 tag = "v${version}";
21 hash = "sha256-qiWuK0gtgGd6D05LJIi1erdWI6QTwo5lJWb6NpSPQa4=";
22 };
23
24 postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
25 # error: unsupported option '-mfloat-abi=' for target 'aarch64-apple-darwin'
26 substituteInPlace setup.py \
27 --replace-fail '"-mfloat-abi=hard",' ""
28 '';
29
30 build-system = [
31 setuptools
32 ];
33
34 pythonImportsCheck = [ "stringzilla" ];
35
36 nativeCheckInputs = [
37 numpy
38 pytest-repeat
39 pytestCheckHook
40 ];
41
42 enabledTestPaths = [ "scripts/test_stringzilla.py" ];
43
44 meta = {
45 changelog = "https://github.com/ashvardanian/StringZilla/releases/tag/${src.tag}";
46 description = "SIMD-accelerated string search, sort, hashes, fingerprints, & edit distances";
47 homepage = "https://github.com/ashvardanian/stringzilla";
48 license = lib.licenses.asl20;
49 maintainers = with lib.maintainers; [ dotlambda ];
50 };
51}