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
|
2024-01-25 14:12:00 +00:00
|
|
|
, readme-renderer
|
2023-10-09 19:29:22 +00:00
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "marisa-trie";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "1.1.0";
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-W/Q+0M82r0V4/nsDTPlfUyQ5dmUWaA5L1gNyNhHr1Ws=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-10-04 12:37:57 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cython
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-10-04 12:37:57 +00:00
|
|
|
pytestCheckHook
|
2024-01-25 14:12:00 +00:00
|
|
|
readme-renderer
|
2021-10-04 12:37:57 +00:00
|
|
|
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";
|
2023-10-09 19:29:22 +00:00
|
|
|
changelog = "https://github.com/pytries/marisa-trie/blob/${version}/CHANGES.rst";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|