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