From 09c71dbb34a454995dfd4ce044fc5059542fb12e Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Mon, 18 Mar 2024 21:59:19 +0100 Subject: [PATCH 1/2] python312Packages.whoosh: normalize pname --- pkgs/development/python-modules/whoosh/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/whoosh/default.nix b/pkgs/development/python-modules/whoosh/default.nix index 10053bc27918..a0f372041e5d 100644 --- a/pkgs/development/python-modules/whoosh/default.nix +++ b/pkgs/development/python-modules/whoosh/default.nix @@ -1,10 +1,11 @@ { lib, buildPythonPackage, fetchPypi, pytest }: buildPythonPackage rec { - pname = "Whoosh"; + pname = "whoosh"; version = "2.7.4"; src = fetchPypi { - inherit pname version; + pname = "Whoosh"; + inherit version; sha256 = "10qsqdjpbc85fykc1vgcs8xwbgn4l2l52c8d83xf1q59pwyn79bw"; }; From ac480bad28b90100de520c0c6787c40371b8cfd1 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 20 Mar 2024 09:31:41 +0100 Subject: [PATCH 2/2] python312Packages.whoosh: refactor --- .../python-modules/whoosh/default.nix | 44 ++++++++++++++----- 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/whoosh/default.nix b/pkgs/development/python-modules/whoosh/default.nix index a0f372041e5d..52831486f2b7 100644 --- a/pkgs/development/python-modules/whoosh/default.nix +++ b/pkgs/development/python-modules/whoosh/default.nix @@ -1,31 +1,51 @@ -{ lib, buildPythonPackage, fetchPypi, pytest }: +{ lib +, buildPythonPackage +, fetchPypi +, pytestCheckHook +, pythonOlder +, setuptools +}: buildPythonPackage rec { pname = "whoosh"; version = "2.7.4"; + pyproject = true; + + disabled = pythonOlder "3.7"; + src = fetchPypi { pname = "Whoosh"; inherit version; - sha256 = "10qsqdjpbc85fykc1vgcs8xwbgn4l2l52c8d83xf1q59pwyn79bw"; + hash = "sha256-fKVjPb+p4OD6QA0xUaigxL7FO9Ls7cCmdwWxdWXDGoM="; }; - nativeCheckInputs = [ pytest ]; + nativeBuildInputs = [ + setuptools + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; # Wrong encoding postPatch = '' rm tests/test_reading.py - substituteInPlace setup.cfg --replace "[pytest]" "[tool:pytest]" - ''; - checkPhase = '' - # FIXME: test_minimize_dfa fails on python 3.6 - py.test -k "not test_timelimit and not test_minimize_dfa" + substituteInPlace setup.cfg \ + --replace-fail "[pytest]" "[tool:pytest]" ''; + pythonImportsCheck = [ + "whoosh" + ]; + + disabledTests = [ + "test_minimize_dfa" + ]; + meta = with lib; { - description = "Fast, pure-Python full text indexing, search, and spell -checking library."; - homepage = "https://bitbucket.org/mchaput/whoosh"; - license = licenses.bsd2; + description = "Fast, pure-Python full text indexing, search, and spell checking library"; + homepage = "https://github.com/mchaput/whoosh"; + license = licenses.bsd2; maintainers = with maintainers; [ ]; }; }