depot/third_party/nixpkgs/pkgs/development/python-modules/cfn-lint/default.nix
Default email 02cf88bb76 Project import generated by Copybara.
GitOrigin-RevId: c4a0efdd5a728e20791b8d8d2f26f90ac228ee8d
2022-08-12 15:06:08 +03:00

95 lines
2.1 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, aws-sam-translator
, jschema-to-python
, jsonpatch
, jsonschema
, junit-xml
, networkx
, pyyaml
, sarif-om
, setuptools
, six
, mock
, pydot
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "cfn-lint";
version = "0.61.2";
src = fetchFromGitHub {
owner = "aws-cloudformation";
repo = "cfn-python-lint";
rev = "refs/tags/v${version}";
sha256 = "sha256-282h1fBWhAfwqCuP+dU3ajn0gQtmOcPNTMKZ0a2+vHU=";
};
postPatch = ''
substituteInPlace setup.py \
--replace "jsonschema~=3.0" "jsonschema>=3.0"
'';
propagatedBuildInputs = [
aws-sam-translator
jschema-to-python
jsonpatch
jsonschema
junit-xml
networkx
pyyaml
sarif-om
six
];
checkInputs = [
mock
pydot
pytestCheckHook
];
preCheck = ''
export PATH=$out/bin:$PATH
'';
disabledTests = [
# These tests depend on the current date, for example because of issues like this.
# This makes it possible for them to succeed on hydra and then begin to fail without
# any code changes.
# https://github.com/aws-cloudformation/cfn-python-lint/issues/1705
# See also: https://github.com/NixOS/nixpkgs/issues/108076
"TestQuickStartTemplates"
# requires git directory
"test_update_docs"
# Tests depend on network access (fails in getaddrinfo)
"test_update_resource_specs_python_2"
"test_update_resource_specs_python_3"
"test_sarif_formatter"
];
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"
];
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";
license = licenses.mit;
};
}