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