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