python312Packages.whoosh: refactor

This commit is contained in:
Fabian Affolter 2024-03-20 09:31:41 +01:00 committed by GitHub
parent 09c71dbb34
commit ac480bad28
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,31 +1,51 @@
{ lib, buildPythonPackage, fetchPypi, pytest }: { lib
, buildPythonPackage
, fetchPypi
, pytestCheckHook
, pythonOlder
, setuptools
}:
buildPythonPackage rec { buildPythonPackage rec {
pname = "whoosh"; pname = "whoosh";
version = "2.7.4"; version = "2.7.4";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchPypi { src = fetchPypi {
pname = "Whoosh"; pname = "Whoosh";
inherit version; inherit version;
sha256 = "10qsqdjpbc85fykc1vgcs8xwbgn4l2l52c8d83xf1q59pwyn79bw"; hash = "sha256-fKVjPb+p4OD6QA0xUaigxL7FO9Ls7cCmdwWxdWXDGoM=";
}; };
nativeCheckInputs = [ pytest ]; nativeBuildInputs = [
setuptools
];
nativeCheckInputs = [
pytestCheckHook
];
# Wrong encoding # Wrong encoding
postPatch = '' postPatch = ''
rm tests/test_reading.py rm tests/test_reading.py
substituteInPlace setup.cfg --replace "[pytest]" "[tool:pytest]" substituteInPlace setup.cfg \
''; --replace-fail "[pytest]" "[tool:pytest]"
checkPhase = ''
# FIXME: test_minimize_dfa fails on python 3.6
py.test -k "not test_timelimit and not test_minimize_dfa"
''; '';
pythonImportsCheck = [
"whoosh"
];
disabledTests = [
"test_minimize_dfa"
];
meta = with lib; { meta = with lib; {
description = "Fast, pure-Python full text indexing, search, and spell description = "Fast, pure-Python full text indexing, search, and spell checking library";
checking library."; homepage = "https://github.com/mchaput/whoosh";
homepage = "https://bitbucket.org/mchaput/whoosh"; license = licenses.bsd2;
license = licenses.bsd2;
maintainers = with maintainers; [ ]; maintainers = with maintainers; [ ];
}; };
} }