1{ lib
2, python3
3, fetchPypi
4, enableTelemetry ? false
5}:
6
7python3.pkgs.buildPythonApplication rec {
8 pname = "aws-sam-cli";
9 version = "1.90.0";
10
11 src = fetchPypi {
12 inherit pname version;
13 hash = "sha256-JXUfc37O6cTTOCTTtWE05m+GR4iDyBsmRPyXoTRxFmo=";
14 };
15
16 propagatedBuildInputs = with python3.pkgs; [
17 aws-lambda-builders
18 aws-sam-translator
19 boto3
20 cfn-lint
21 chevron
22 cookiecutter
23 dateparser
24 docker
25 flask
26 pyopenssl
27 pyyaml
28 rich
29 ruamel-yaml
30 serverlessrepo
31 tomlkit
32 typing-extensions
33 tzlocal
34 watchdog
35 ];
36
37 postFixup = if enableTelemetry then "echo aws-sam-cli TELEMETRY IS ENABLED" else ''
38 # Disable telemetry: https://github.com/awslabs/aws-sam-cli/issues/1272
39 wrapProgram $out/bin/sam --set SAM_CLI_TELEMETRY 0
40 '';
41
42 postPatch = ''
43 substituteInPlace requirements/base.txt \
44 --replace 'PyYAML>=' 'PyYAML>=5.4.1 #' \
45 --replace "aws_lambda_builders==" "aws_lambda_builders>=" \
46 --replace 'aws-sam-translator==1.70.0' 'aws-sam-translator>=1.60.1' \
47 --replace 'boto3>=' 'boto3>=1.26.79 #' \
48 --replace 'cfn-lint~=0.77.9' 'cfn-lint~=0.73.2' \
49 --replace "cookiecutter~=" "cookiecutter>=" \
50 --replace 'docker~=6.1.0' 'docker~=6.0.1' \
51 --replace 'ruamel_yaml~=0.17.32' 'ruamel_yaml~=0.17.21' \
52 --replace 'tomlkit==0.11.8' 'tomlkit>=0.11.8' \
53 --replace 'typing_extensions~=4.4.0' 'typing_extensions~=4.4' \
54 --replace 'tzlocal==3.0' 'tzlocal>=3.0' \
55 --replace 'watchdog==' 'watchdog>=2.1.2 #'
56 '';
57
58 doCheck = false;
59
60 meta = with lib; {
61 description = "CLI tool for local development and testing of Serverless applications";
62 homepage = "https://github.com/awslabs/aws-sam-cli";
63 changelog = "https://github.com/aws/aws-sam-cli/releases/tag/v${version}";
64 license = licenses.asl20;
65 maintainers = with maintainers; [ lo1tuma ];
66 };
67}