1{
2 lib,
3 buildPythonPackage,
4 cython,
5 fetchFromGitHub,
6 jq,
7 oniguruma,
8 pytestCheckHook,
9 pythonOlder,
10}:
11
12buildPythonPackage rec {
13 pname = "jq";
14 version = "1.10.0";
15 format = "setuptools";
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchFromGitHub {
20 owner = "mwilliamson";
21 repo = "jq.py";
22 tag = version;
23 hash = "sha256-xzkOWIMvGBVJtdZWFFIQkfgTivMTxV+dze71E8S6SlM=";
24 };
25
26 env.JQPY_USE_SYSTEM_LIBS = 1;
27
28 nativeBuildInputs = [ cython ];
29
30 buildInputs = [
31 jq
32 oniguruma
33 ];
34
35 preBuild = ''
36 cython jq.pyx
37 '';
38
39 nativeCheckInputs = [ pytestCheckHook ];
40
41 disabledTests = [
42 # tries to match exact error text, fails with jq 1.8
43 "test_value_error_is_raised_if_program_is_invalid"
44 ];
45
46 pythonImportsCheck = [ "jq" ];
47
48 meta = with lib; {
49 description = "Python bindings for jq, the flexible JSON processor";
50 homepage = "https://github.com/mwilliamson/jq.py";
51 changelog = "https://github.com/mwilliamson/jq.py/blob/${version}/CHANGELOG.rst";
52 license = licenses.bsd2;
53 maintainers = with maintainers; [ benley ];
54 };
55}