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