nixpkgs/pkgs/development/python-modules/yq/default.nix
Martin Weinelt 0215034f25 python3.pkgs: Migrate fetchers to use hash
when they already rely on SRI hashes.
2023-03-03 23:59:29 +01:00

56 lines
967 B
Nix

{ lib
, buildPythonPackage
, fetchPypi
, substituteAll
, argcomplete
, pyyaml
, toml
, xmltodict
, jq
, setuptools-scm
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "yq";
version = "3.1.1";
src = fetchPypi {
inherit pname version;
hash = "sha256-hT80KxVi3e6XkDjsjs7lQFzdm2p8uB7WzbgBjJ6AJjM=";
};
patches = [
(substituteAll {
src = ./jq-path.patch;
jq = "${lib.getBin jq}/bin/jq";
})
];
nativeBuildInputs = [
setuptools-scm
];
propagatedBuildInputs = [
pyyaml
xmltodict
toml
argcomplete
];
nativeCheckInputs = [
pytestCheckHook
];
pytestFlagsArray = [ "test/test.py" ];
pythonImportsCheck = [ "yq" ];
meta = with lib; {
description = "Command-line YAML/XML/TOML processor - jq wrapper for YAML, XML, TOML documents";
homepage = "https://github.com/kislyuk/yq";
license = licenses.asl20;
maintainers = with maintainers; [ womfoo SuperSandro2000 ];
};
}