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