2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2021-03-12 07:09:13 +00:00
|
|
|
, cython
|
2021-06-28 23:13:55 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, hypothesis
|
2021-10-04 12:37:57 +00:00
|
|
|
, readme_renderer
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "marisa-trie";
|
2022-12-17 10:02:37 +00:00
|
|
|
version = "0.7.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-12-17 10:02:37 +00:00
|
|
|
sha256 = "sha256-ruPeXyg2B0z9gD8crxb2g5DyYu8JzX3H0Oiu6baHhkM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-10-04 12:37:57 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cython
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
readme_renderer
|
|
|
|
hypothesis
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "hypothesis==" "hypothesis>="
|
|
|
|
'';
|
|
|
|
|
2021-03-12 07:09:13 +00:00
|
|
|
preBuild = ''
|
|
|
|
./update_cpp.sh
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-10-04 12:37:57 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
# Don't test packaging
|
|
|
|
"tests/test_packaging.py"
|
2021-06-28 23:13:55 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Pins hypothesis==2.0.0 from 2016/01 which complains about
|
2021-10-04 12:37:57 +00:00
|
|
|
# hypothesis.errors.FailedHealthCheck: tests/test_trie.py::[...] uses
|
|
|
|
# the 'tmpdir' fixture, which is reset between function calls but not
|
|
|
|
# between test cases generated by `@given(...)`.
|
2021-06-28 23:13:55 +00:00
|
|
|
"test_saveload"
|
|
|
|
"test_mmap"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-10-04 12:37:57 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"marisa_trie"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2021-10-04 12:37:57 +00:00
|
|
|
description = "Static memory-efficient Trie-like structures for Python based on marisa-trie C++ library";
|
|
|
|
longDescription = ''
|
|
|
|
There are official SWIG-based Python bindings included in C++ library distribution.
|
|
|
|
This package provides alternative Cython-based pip-installable Python bindings.
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/kmike/marisa-trie";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ ixxie ];
|
|
|
|
};
|
|
|
|
}
|