1{ lib
2, buildPythonPackage
3, fetchPypi
4, cython
5, pytestCheckHook
6, hypothesis
7, readme_renderer
8}:
9
10buildPythonPackage rec {
11 pname = "marisa-trie";
12 version = "0.8.0";
13
14 src = fetchPypi {
15 inherit pname version;
16 hash = "sha256-PQGdF7DX9i1ubXvQUjbYJSYk6hwUC+uL+cbu/zizxwc=";
17 };
18
19 nativeBuildInputs = [
20 cython
21 ];
22
23 nativeCheckInputs = [
24 pytestCheckHook
25 readme_renderer
26 hypothesis
27 ];
28
29 postPatch = ''
30 substituteInPlace setup.py \
31 --replace "hypothesis==" "hypothesis>="
32 '';
33
34 preBuild = ''
35 ./update_cpp.sh
36 '';
37
38 disabledTestPaths = [
39 # Don't test packaging
40 "tests/test_packaging.py"
41 ];
42
43 disabledTests = [
44 # Pins hypothesis==2.0.0 from 2016/01 which complains about
45 # hypothesis.errors.FailedHealthCheck: tests/test_trie.py::[...] uses
46 # the 'tmpdir' fixture, which is reset between function calls but not
47 # between test cases generated by `@given(...)`.
48 "test_saveload"
49 "test_mmap"
50 ];
51
52 pythonImportsCheck = [
53 "marisa_trie"
54 ];
55
56 meta = with lib; {
57 description = "Static memory-efficient Trie-like structures for Python based on marisa-trie C++ library";
58 longDescription = ''
59 There are official SWIG-based Python bindings included in C++ library distribution.
60 This package provides alternative Cython-based pip-installable Python bindings.
61 '';
62 homepage = "https://github.com/kmike/marisa-trie";
63 license = licenses.mit;
64 maintainers = with maintainers; [ ixxie ];
65 };
66}