biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / development / tools / aws-sam-cli / default.nix
blob5f359f5cb16d0653494928e980710e288b0a5aae
1 { lib
2 , python3
3 , fetchFromGitHub
4 , git
5 , testers
6 , aws-sam-cli
7 , nix-update-script
8 , enableTelemetry ? false
9 }:
11 python3.pkgs.buildPythonApplication rec {
12   pname = "aws-sam-cli";
13   version = "1.115.0";
14   pyproject = true;
16   disabled = python3.pythonOlder "3.8";
18   src = fetchFromGitHub {
19     owner = "aws";
20     repo = "aws-sam-cli";
21     rev = "refs/tags/v${version}";
22     hash = "sha256-VYcgKnTNMuF4lMjoyHk0mDYTngFIouqnPZXpZ5gt9hQ=";
23   };
25   build-system = with python3.pkgs; [
26     pythonRelaxDepsHook
27     setuptools
28   ];
30   pythonRelaxDeps = [
31     "aws-lambda-builders"
32     "aws-sam-translator"
33     "boto3-stubs"
34     "cfn-lint"
35     "cookiecutter"
36     "docker"
37     "jsonschema"
38     "pyopenssl"
39     "rich"
40     "ruamel-yaml"
41     "tomlkit"
42     "tzlocal"
43   ];
45   dependencies = with python3.pkgs; [
46     aws-lambda-builders
47     aws-sam-translator
48     boto3
49     boto3-stubs
50     cfn-lint
51     chevron
52     click
53     cookiecutter
54     dateparser
55     docker
56     flask
57     jsonschema
58     pyopenssl
59     pyyaml
60     requests
61     rich
62     ruamel-yaml
63     tomlkit
64     typing-extensions
65     tzlocal
66     watchdog
67   ] ++ (with python3.pkgs.boto3-stubs.optional-dependencies; [
68     apigateway
69     cloudformation
70     ecr
71     iam
72     kinesis
73     lambda
74     s3
75     schemas
76     secretsmanager
77     signer
78     sqs
79     stepfunctions
80     sts
81     xray
82   ]);
84   postFixup = ''
85     # Disable telemetry: https://github.com/aws/aws-sam-cli/issues/1272
86     wrapProgram $out/bin/sam \
87       --set SAM_CLI_TELEMETRY ${if enableTelemetry then "1" else "0"} \
88       --prefix PATH : $out/bin:${lib.makeBinPath [ git ]}
89   '';
91   nativeCheckInputs = with python3.pkgs; [
92     filelock
93     flaky
94     parameterized
95     psutil
96     pytest-timeout
97     pytest-xdist
98     pytestCheckHook
99   ];
101   preCheck = ''
102     export HOME=$(mktemp -d)
103     export PATH="$PATH:$out/bin:${lib.makeBinPath [ git ]}"
104   '';
106   pytestFlagsArray = [
107     "tests"
108     # Disable warnings
109     "-W"
110     "ignore::DeprecationWarning"
111   ];
113   disabledTestPaths = [
114     # Disable tests that requires networking or complex setup
115     "tests/end_to_end"
116     "tests/integration"
117     "tests/regression"
118     "tests/smoke"
119     "tests/unit/lib/telemetry"
120     # Disable flaky tests
121     "tests/unit/lib/samconfig/test_samconfig.py"
122   ];
124   disabledTests = [
125     # Disable flaky tests
126     "test_update_stage"
127     "test_delete_deployment"
128     "test_request_with_no_data"
129   ];
131   pythonImportsCheck = [
132     "samcli"
133   ];
135   passthru = {
136     tests.version = testers.testVersion {
137       package = aws-sam-cli;
138       command = "sam --version";
139     };
140     updateScript = nix-update-script {
141       extraArgs = [ "--version-regex" "^v([0-9.]+)$" ];
142     };
143   };
145   __darwinAllowLocalNetworking = true;
147   meta = with lib; {
148     description = "CLI tool for local development and testing of Serverless applications";
149     homepage = "https://github.com/aws/aws-sam-cli";
150     changelog = "https://github.com/aws/aws-sam-cli/releases/tag/v${version}";
151     license = licenses.asl20;
152     mainProgram = "sam";
153     maintainers = with maintainers; [ lo1tuma anthonyroussel ];
154   };