Merge pull request #119126 from fabaff/pycomfoconnect
[NixPkgs.git] / pkgs / development / python-modules / cfn-lint / default.nix
blobf55042c58d235eb2098ee4bc3df2e19145e6e992
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , pythonOlder
5 , aws-sam-translator
6 , importlib-metadata
7 , importlib-resources
8 , jsonpatch
9 , jsonschema
10 , junit-xml
11 , networkx
12 , pathlib2
13 , pyyaml
14 , requests
15 , setuptools
16 , six
17 , mock
18 , pydot
19 , pytestCheckHook
22 buildPythonPackage rec {
23   pname = "cfn-lint";
24   version = "0.42.0";
26   src = fetchFromGitHub {
27     owner = "aws-cloudformation";
28     repo = "cfn-python-lint";
29     rev = "v${version}";
30     sha256 = "0cqpq7pxpslpd7am6mp6nmwhsb2p2a5lq3hjjxi8imv3wv7zql98";
31   };
33   postPatch = ''
34     substituteInPlace setup.py \
35       --replace 'importlib_resources~=1.4;python_version<"3.7" and python_version!="3.4"' 'importlib_resources;python_version<"3.7"'
36   '';
38   propagatedBuildInputs = [
39     aws-sam-translator
40     jsonpatch
41     jsonschema
42     junit-xml
43     networkx
44     pathlib2
45     pyyaml
46     requests
47     setuptools
48     six
49   ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata importlib-resources ];
51   checkInputs = [
52     mock
53     pydot
54     pytestCheckHook
55   ];
57   preCheck = ''
58     export PATH=$out/bin:$PATH
59   '';
61   disabledTests = [
62     # These tests depend on the current date, for example because of issues like this.
63     # This makes it possible for them to succeed on hydra and then begin to fail without
64     # any code changes.
65     # https://github.com/aws-cloudformation/cfn-python-lint/issues/1705
66     # See also: https://github.com/NixOS/nixpkgs/issues/108076
67     "TestQuickStartTemplates"
68     # requires git directory
69     "test_update_docs"
70   ];
72   pythonImportsCheck = [
73     "cfnlint"
74     "cfnlint.conditions"
75     "cfnlint.core"
76     "cfnlint.decode.node"
77     "cfnlint.decode.cfn_yaml"
78     "cfnlint.decode.cfn_json"
79     "cfnlint.decorators.refactored"
80     "cfnlint.graph"
81     "cfnlint.helpers"
82     "cfnlint.rules"
83     "cfnlint.runner"
84     "cfnlint.template"
85     "cfnlint.transform"
86   ];
88   meta = with lib; {
89     description = "Checks cloudformation for practices and behaviour that could potentially be improved";
90     homepage = "https://github.com/aws-cloudformation/cfn-python-lint";
91     changelog = "https://github.com/aws-cloudformation/cfn-python-lint/blob/master/CHANGELOG.md";
92     license = licenses.mit;
93   };