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

77 lines
1.7 KiB
Nix
Raw Normal View History

2019-05-01 09:59:49 +01:00
{ lib
, buildPythonPackage
, fetchFromGitHub
2019-12-21 09:52:28 +00:00
, pythonOlder
2019-05-01 09:59:49 +01:00
, aws-sam-translator
2019-12-21 09:52:28 +00:00
, importlib-metadata
, importlib-resources
2019-05-01 09:59:49 +01:00
, jsonpatch
, jsonschema
2020-06-11 09:49:49 +01:00
, junit-xml
, networkx
, pathlib2
, pyyaml
, requests
, setuptools
, six
# Test inputs
, pytestCheckHook
, mock
, pydot
2019-05-01 09:59:49 +01:00
}:
buildPythonPackage rec {
pname = "cfn-lint";
version = "0.35.1";
2019-05-01 09:59:49 +01:00
src = fetchFromGitHub {
owner = "aws-cloudformation";
repo = "cfn-python-lint";
rev = "v${version}";
sha256 = "1ajb0412hw9fg9m4b3xbpfbp8cixmnpjxrkaks6k749xinzsv7qk";
2019-05-01 09:59:49 +01:00
};
postPatch = ''
substituteInPlace setup.py --replace 'importlib_resources~=1.4;python_version<"3.7" and python_version!="3.4"' 'importlib_resources;python_version<"3.7"'
'';
2019-05-01 09:59:49 +01:00
propagatedBuildInputs = [
aws-sam-translator
jsonpatch
jsonschema
2020-06-11 09:49:49 +01:00
junit-xml
networkx
pathlib2
pyyaml
requests
setuptools
six
2019-12-21 09:52:28 +00:00
] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata importlib-resources ];
2019-05-01 09:59:49 +01:00
pythonImportsCheck = [
"cfnlint"
"cfnlint.conditions"
"cfnlint.core"
"cfnlint.decode.node"
"cfnlint.decode.cfn_yaml"
"cfnlint.decode.cfn_json"
"cfnlint.decorators.refactored"
"cfnlint.graph"
"cfnlint.helpers"
"cfnlint.rules"
"cfnlint.runner"
"cfnlint.template"
"cfnlint.transform"
];
2019-05-01 09:59:49 +01:00
checkInputs = [ pytestCheckHook mock pydot ];
preCheck = "export PATH=$out/bin:$PATH";
2019-05-01 09:59:49 +01:00
meta = with lib; {
description = "Checks cloudformation for practices and behaviour that could potentially be improved";
homepage = "https://github.com/aws-cloudformation/cfn-python-lint";
changelog = "https://github.com/aws-cloudformation/cfn-python-lint/blob/master/CHANGELOG.md";
2019-05-01 09:59:49 +01:00
license = licenses.mit;
};
}