1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pytestCheckHook
5}:
6
7buildPythonPackage rec {
8 pname = "pyahocorasick";
9 version = "1.4.1";
10
11 src = fetchFromGitHub {
12 owner = "WojciechMula";
13 repo = pname;
14 rev = version;
15 sha256 = "13x3718if28l50474xrz1b9709kvnvdg3nzm6y8bh7mc9a4zyss5";
16 };
17
18 postPatch = ''
19 substituteInPlace unittests.py \
20 --replace '(tmp, "test.dat")' "(\"$TMPDIR\", \"test.dat\")"
21 '';
22
23 checkInputs = [ pytestCheckHook ];
24
25 pytestFlagsArray = [ "unittests.py" ];
26 pythonImportsCheck = [ "ahocorasick" ];
27
28 meta = with lib; {
29 description = "Python module implementing Aho-Corasick algorithm";
30 longDescription = ''
31 This Python module is a fast and memory efficient library for exact or
32 approximate multi-pattern string search meaning that you can find multiple
33 key strings occurrences at once in some input text.
34 '';
35 homepage = "https://github.com/WojciechMula/pyahocorasick";
36 license = with licenses; [ bsd3 ];
37 maintainers = with maintainers; [ fab ];
38 };
39}