1{ lib
2, argcomplete
3, buildPythonPackage
4, fetchPypi
5, jq
6, pytestCheckHook
7, pyyaml
8, setuptools-scm
9, substituteAll
10, tomlkit
11, xmltodict
12}:
13
14buildPythonPackage rec {
15 pname = "yq";
16 version = "3.2.3";
17
18 src = fetchPypi {
19 inherit pname version;
20 hash = "sha256-Kcj+HTa09kFj9NATFMauIXU5hw9hAhbe5gJd+16vr7E=";
21 };
22
23 patches = [
24 (substituteAll {
25 src = ./jq-path.patch;
26 jq = "${lib.getBin jq}/bin/jq";
27 })
28 ];
29
30 nativeBuildInputs = [
31 setuptools-scm
32 ];
33
34 propagatedBuildInputs = [
35 argcomplete
36 pyyaml
37 tomlkit
38 xmltodict
39 ];
40
41 nativeCheckInputs = [
42 pytestCheckHook
43 ];
44
45 pytestFlagsArray = [ "test/test.py" ];
46
47 pythonImportsCheck = [ "yq" ];
48
49 meta = with lib; {
50 description = "Command-line YAML/XML/TOML processor - jq wrapper for YAML, XML, TOML documents";
51 homepage = "https://github.com/kislyuk/yq";
52 license = licenses.asl20;
53 maintainers = with maintainers; [ womfoo SuperSandro2000 ];
54 mainProgram = "yq";
55 };
56}