nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 aws-sam-translator,
4 buildPythonPackage,
5 defusedxml,
6 fetchFromGitHub,
7 jschema-to-python,
8 jsonpatch,
9 junit-xml,
10 mock,
11 networkx,
12 pydot,
13 pytestCheckHook,
14 pyyaml,
15 regex,
16 sarif-om,
17 setuptools,
18 sympy,
19 typing-extensions,
20}:
21
22buildPythonPackage rec {
23 pname = "cfn-lint";
24 version = "1.43.3";
25 pyproject = true;
26
27 src = fetchFromGitHub {
28 owner = "aws-cloudformation";
29 repo = "cfn-lint";
30 tag = "v${version}";
31 hash = "sha256-tolQ7O6J/pfmtw29t8SGBDEDGiTOsJdc/mI3ulUseKo=";
32 };
33
34 build-system = [ setuptools ];
35
36 dependencies = [
37 aws-sam-translator
38 jsonpatch
39 networkx
40 pyyaml
41 regex
42 sympy
43 typing-extensions
44 ];
45
46 optional-dependencies = {
47 graph = [ pydot ];
48 junit = [ junit-xml ];
49 sarif = [
50 jschema-to-python
51 sarif-om
52 ];
53 full = lib.concatAttrValues (lib.removeAttrs optional-dependencies [ "full" ]);
54 };
55
56 nativeCheckInputs = [
57 defusedxml
58 mock
59 pytestCheckHook
60 ]
61 ++ optional-dependencies.full;
62
63 preCheck = ''
64 export PATH=$out/bin:$PATH
65 '';
66
67 disabledTests = [
68 # Requires git directory
69 "test_update_docs"
70 ];
71
72 pythonImportsCheck = [ "cfnlint" ];
73
74 meta = {
75 description = "Checks cloudformation for practices and behaviour that could potentially be improved";
76 mainProgram = "cfn-lint";
77 homepage = "https://github.com/aws-cloudformation/cfn-lint";
78 changelog = "https://github.com/aws-cloudformation/cfn-lint/blob/${src.tag}/CHANGELOG.md";
79 license = lib.licenses.mit;
80 maintainers = [ ];
81 };
82}