2020-08-15 08:27:07 +01:00
|
|
|
{ lib
|
2020-09-19 15:26:21 +01:00
|
|
|
, buildPythonPackage
|
2020-08-15 08:27:07 +01:00
|
|
|
, fetchPypi
|
2020-09-19 15:26:21 +01:00
|
|
|
, pkgs
|
2020-08-15 08:27:07 +01:00
|
|
|
, argcomplete
|
|
|
|
, pyyaml
|
|
|
|
, xmltodict
|
|
|
|
# Test inputs
|
|
|
|
, coverage
|
|
|
|
, flake8
|
|
|
|
, jq
|
|
|
|
, pytest
|
2020-09-21 19:08:22 +01:00
|
|
|
, unixtools
|
2020-08-15 08:27:07 +01:00
|
|
|
, toml
|
|
|
|
}:
|
2017-11-13 18:32:13 +00:00
|
|
|
|
2020-09-19 15:26:21 +01:00
|
|
|
buildPythonPackage rec {
|
2017-11-13 18:32:13 +00:00
|
|
|
pname = "yq";
|
2020-10-01 14:21:21 +01:00
|
|
|
version = "2.11.1";
|
2017-11-13 18:32:13 +00:00
|
|
|
|
2020-09-19 15:26:21 +01:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-10-01 14:21:21 +01:00
|
|
|
sha256 = "1q4rky0a6n4izmq7slb91a54g8swry1xrbfqxwc8lkd3hhvlxxkl";
|
2020-09-19 15:26:21 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
pyyaml
|
|
|
|
xmltodict
|
|
|
|
argcomplete
|
|
|
|
];
|
2017-11-13 18:32:13 +00:00
|
|
|
|
2020-08-15 08:27:07 +01:00
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
checkInputs = [
|
2020-09-21 19:08:22 +01:00
|
|
|
unixtools.script
|
2020-08-15 08:27:07 +01:00
|
|
|
pytest
|
|
|
|
coverage
|
|
|
|
flake8
|
2020-09-19 15:26:21 +01:00
|
|
|
pkgs.jq
|
2020-08-15 08:27:07 +01:00
|
|
|
toml
|
|
|
|
];
|
|
|
|
|
2020-09-21 19:08:22 +01:00
|
|
|
# tests fails if stdin is not a tty
|
|
|
|
checkPhase = "echo | script -c 'pytest ./test/test.py'";
|
2017-11-13 18:32:13 +00:00
|
|
|
|
2020-09-19 15:26:21 +01:00
|
|
|
pythonImportsCheck = [ "yq" ];
|
2017-11-13 18:32:13 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2020-10-11 06:55:05 +01:00
|
|
|
description = "Command-line YAML processor - jq wrapper for YAML documents";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/kislyuk/yq";
|
2017-11-13 18:32:13 +00:00
|
|
|
license = [ licenses.asl20 ];
|
|
|
|
maintainers = [ maintainers.womfoo ];
|
|
|
|
};
|
|
|
|
}
|