3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/python-modules/yq/default.nix

56 lines
952 B
Nix
Raw Normal View History

{ lib
, buildPythonPackage
, fetchPypi
, pkgs
, argcomplete
, pyyaml
, xmltodict
# Test inputs
, coverage
, flake8
, jq
, pytest
, toml
}:
2017-11-13 18:32:13 +00:00
buildPythonPackage rec {
2017-11-13 18:32:13 +00:00
pname = "yq";
version = "2.10.1";
2017-11-13 18:32:13 +00:00
src = fetchPypi {
inherit pname version;
sha256 = "1h6nnkp53mm4spwy8nyxwvh9j6p4lxvf20j4bgjskhnhaw3jl9gn";
};
postPatch = ''
substituteInPlace test/test.py --replace "expect_exit_codes={0} if sys.stdin.isatty() else {2}" "expect_exit_codes={0}"
'';
propagatedBuildInputs = [
pyyaml
xmltodict
argcomplete
];
2017-11-13 18:32:13 +00:00
doCheck = true;
checkInputs = [
pytest
coverage
flake8
pkgs.jq
toml
];
checkPhase = "pytest ./test/test.py";
2017-11-13 18:32:13 +00:00
pythonImportsCheck = [ "yq" ];
2017-11-13 18:32:13 +00:00
meta = with lib; {
description = "Command-line YAML processor - jq wrapper for YAML documents.";
homepage = "https://github.com/kislyuk/yq";
2017-11-13 18:32:13 +00:00
license = [ licenses.asl20 ];
maintainers = [ maintainers.womfoo ];
};
}