2020-08-20 17:08:02 +00:00
|
|
|
{ lib
|
2020-09-25 04:45:31 +00:00
|
|
|
, buildPythonPackage
|
2020-08-20 17:08:02 +00:00
|
|
|
, fetchPypi
|
2020-09-25 04:45:31 +00:00
|
|
|
, pkgs
|
2020-08-20 17:08:02 +00:00
|
|
|
, argcomplete
|
|
|
|
, pyyaml
|
|
|
|
, xmltodict
|
|
|
|
# Test inputs
|
|
|
|
, coverage
|
|
|
|
, flake8
|
|
|
|
, jq
|
|
|
|
, pytest
|
2020-09-25 04:45:31 +00:00
|
|
|
, unixtools
|
2020-08-20 17:08:02 +00:00
|
|
|
, toml
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
buildPythonPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "yq";
|
2020-09-25 04:45:31 +00:00
|
|
|
version = "2.11.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
|
|
|
sha256 = "1gp9q5w1bjbw7wmba5hm8ippwvkind0p02n07fqa9jlqglhxhm46";
|
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
pyyaml
|
|
|
|
xmltodict
|
|
|
|
argcomplete
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
checkInputs = [
|
2020-09-25 04:45:31 +00:00
|
|
|
unixtools.script
|
2020-08-20 17:08:02 +00:00
|
|
|
pytest
|
|
|
|
coverage
|
|
|
|
flake8
|
2020-09-25 04:45:31 +00:00
|
|
|
pkgs.jq
|
2020-08-20 17:08:02 +00:00
|
|
|
toml
|
|
|
|
];
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
# tests fails if stdin is not a tty
|
|
|
|
checkPhase = "echo | script -c 'pytest ./test/test.py'";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
pythonImportsCheck = [ "yq" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Command-line YAML processor - jq wrapper for YAML documents.";
|
|
|
|
homepage = "https://github.com/kislyuk/yq";
|
|
|
|
license = [ licenses.asl20 ];
|
|
|
|
maintainers = [ maintainers.womfoo ];
|
|
|
|
};
|
|
|
|
}
|