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