1{ lib
2, aws-sam-translator
3, buildPythonPackage
4, fetchFromGitHub
5, jschema-to-python
6, jsonpatch
7, jsonschema
8, junit-xml
9, mock
10, networkx
11, pydot
12, pytestCheckHook
13, pythonOlder
14, pyyaml
15, regex
16, sarif-om
17, setuptools
18, sympy
19}:
20
21buildPythonPackage rec {
22 pname = "cfn-lint";
23 version = "0.79.11";
24 format = "setuptools";
25
26 disabled = pythonOlder "3.7";
27
28 src = fetchFromGitHub {
29 owner = "aws-cloudformation";
30 repo = "cfn-python-lint";
31 rev = "refs/tags/v${version}";
32 hash = "sha256-dVLKMoZzP2q3bejEIslgpQgkPJOJUeEsXyyk8HRP6h0=";
33 };
34
35 propagatedBuildInputs = [
36 aws-sam-translator
37 jschema-to-python
38 jsonpatch
39 jsonschema
40 junit-xml
41 networkx
42 networkx
43 pyyaml
44 regex
45 sarif-om
46 sympy
47 ];
48
49 nativeCheckInputs = [
50 mock
51 pydot
52 pytestCheckHook
53 ];
54
55 preCheck = ''
56 export PATH=$out/bin:$PATH
57 '';
58
59 disabledTests = [
60 # These tests depend on the current date, for example because of issues like this.
61 # This makes it possible for them to succeed on hydra and then begin to fail without
62 # any code changes.
63 # https://github.com/aws-cloudformation/cfn-python-lint/issues/1705
64 # See also: https://github.com/NixOS/nixpkgs/issues/108076
65 "TestQuickStartTemplates"
66 # Requires git directory
67 "test_update_docs"
68 # Tests depend on network access (fails in getaddrinfo)
69 "test_update_resource_specs_python_2"
70 "test_update_resource_specs_python_3"
71 "test_sarif_formatter"
72 # Some CLI tests fails
73 "test_bad_config"
74 "test_override_parameters"
75 "test_positional_template_parameters"
76 "test_template_config"
77 ];
78
79 pythonImportsCheck = [
80 "cfnlint"
81 ];
82
83 meta = with lib; {
84 description = "Checks cloudformation for practices and behaviour that could potentially be improved";
85 homepage = "https://github.com/aws-cloudformation/cfn-python-lint";
86 changelog = "https://github.com/aws-cloudformation/cfn-lint/blob/v${version}/CHANGELOG.md";
87 license = licenses.mit;
88 maintainers = with maintainers; [ ];
89 };
90}