Merge pull request #271432 from fabaff/luqum-fix

python311Packages.luqum: refactor

authored by Fabian Affolter and committed by GitHub 1054ed56 ae4f0a84

+33 -12
+33 -12
pkgs/development/python-modules/luqum/default.nix
··· 1 1 { lib 2 2 , buildPythonPackage 3 + , elastic-transport 4 + , elasticsearch-dsl 3 5 , fetchFromGitHub 4 - , pythonOlder 5 - # dependencies 6 6 , ply 7 - # test dependencies 8 - , elasticsearch-dsl 7 + , pytestCheckHook 8 + , pythonOlder 9 + , setuptools 9 10 }: 10 - let 11 + 12 + buildPythonPackage rec { 11 13 pname = "luqum"; 12 14 version = "0.13.0"; 13 - in 14 - buildPythonPackage { 15 - inherit pname version; 16 - format = "setuptools"; 15 + pyproject = true; 17 16 18 17 disabled = pythonOlder "3.8"; 19 18 20 19 src = fetchFromGitHub { 21 20 owner = "jurismarches"; 22 - repo = pname; 23 - rev = version; 21 + repo = "luqum"; 22 + rev = "refs/tags/${version}"; 24 23 hash = "sha256-lcJCLl0crCl3Y5UlWBMZJR2UtVP96gaJNRxwY9Xn7TM="; 25 24 }; 26 25 26 + postPatch = '' 27 + substituteInPlace pyproject.toml \ 28 + --replace '--doctest-modules --doctest-glob="test_*.rst" --cov=luqum --cov-branch --cov-report html --no-cov-on-fail' "" 29 + ''; 30 + 31 + nativeBuildInputs = [ 32 + setuptools 33 + ]; 34 + 27 35 propagatedBuildInputs = [ 28 36 ply 29 37 ]; 30 38 31 39 nativeCheckInputs = [ 40 + elastic-transport 32 41 elasticsearch-dsl 42 + pytestCheckHook 43 + ]; 44 + 45 + pythonImportsCheck = [ 46 + "luqum" 47 + ]; 48 + 49 + disabledTestPaths = [ 50 + # Tests require an Elasticsearch instance 51 + "tests/test_elasticsearch/test_es_integration.py" 52 + "tests/test_elasticsearch/test_es_naming.py" 33 53 ]; 34 54 35 55 meta = with lib; { 36 - description = "A lucene query parser generating ElasticSearch queries and more !"; 56 + description = "A lucene query parser generating ElasticSearch queries"; 37 57 homepage = "https://github.com/jurismarches/luqum"; 58 + changelog = "https://github.com/jurismarches/luqum/releases/tag/${version}"; 38 59 license = licenses.asl20; 39 60 maintainers = with maintainers; [ happysalada ]; 40 61 };