Merge pull request #98282 from mweinelt/python/yq

pythonPackages.yq: update, repackage as library, fix tests
This commit is contained in:
Jörg Thalheim 2020-09-21 20:43:10 +02:00 committed by GitHub
commit 4eb55225a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 14 deletions

View File

@ -1,6 +1,7 @@
{ lib { lib
, buildPythonApplication , buildPythonPackage
, fetchPypi , fetchPypi
, pkgs
, argcomplete , argcomplete
, pyyaml , pyyaml
, xmltodict , xmltodict
@ -9,31 +10,40 @@
, flake8 , flake8
, jq , jq
, pytest , pytest
, unixtools
, toml , toml
}: }:
buildPythonApplication rec { buildPythonPackage rec {
pname = "yq"; pname = "yq";
version = "2.10.1"; version = "2.11.0";
propagatedBuildInputs = [ pyyaml xmltodict jq argcomplete ]; src = fetchPypi {
inherit pname version;
sha256 = "1gp9q5w1bjbw7wmba5hm8ippwvkind0p02n07fqa9jlqglhxhm46";
};
propagatedBuildInputs = [
pyyaml
xmltodict
argcomplete
];
doCheck = true; doCheck = true;
checkInputs = [ checkInputs = [
unixtools.script
pytest pytest
coverage coverage
flake8 flake8
jq pkgs.jq
toml toml
]; ];
checkPhase = "pytest ./test/test.py"; # tests fails if stdin is not a tty
checkPhase = "echo | script -c 'pytest ./test/test.py'";
src = fetchPypi { pythonImportsCheck = [ "yq" ];
inherit pname version;
sha256 = "1h6nnkp53mm4spwy8nyxwvh9j6p4lxvf20j4bgjskhnhaw3jl9gn";
};
meta = with lib; { meta = with lib; {
description = "Command-line YAML processor - jq wrapper for YAML documents."; description = "Command-line YAML processor - jq wrapper for YAML documents.";

View File

@ -11801,10 +11801,7 @@ in
yodl = callPackage ../development/tools/misc/yodl { }; yodl = callPackage ../development/tools/misc/yodl { };
yq = callPackage ../development/tools/yq { yq = python3.pkgs.toPythonApplication python3.pkgs.yq;
inherit (python3Packages)
buildPythonApplication fetchPypi argcomplete pyyaml xmltodict pytest coverage flake8 toml;
};
yq-go = callPackage ../development/tools/yq-go { }; yq-go = callPackage ../development/tools/yq-go { };

View File

@ -7622,6 +7622,8 @@ in {
yowsup = callPackage ../development/python-modules/yowsup { }; yowsup = callPackage ../development/python-modules/yowsup { };
yq = callPackage ../development/python-modules/yq { };
yt = callPackage ../development/python-modules/yt { }; yt = callPackage ../development/python-modules/yt { };
yubico-client = callPackage ../development/python-modules/yubico-client { }; yubico-client = callPackage ../development/python-modules/yubico-client { };