nixpkgs/pkgs/development/tools/aws-sam-cli/default.nix
Ian Liu Rodrigues 9f5df22dba aws-sam-cli: 1.53.0 -> 1.90.0
aws-sam-cli is too outdated, and can't create newer resources available
in AWS, such as AWS Lambda functions with python3.10 runtime. This patch
fixes this problem.

Also, both patches were already applied upstream, as referenced below:

 * support-click-8-1.patch -> c887458ccf (diff-a7e8dd2d23df6667705bc0c8236e507a39bfb7b924ea21d0dca7715c296e43dc)
 * use_forward_compatible_log_silencing.patch -> 0fd46082d6 (diff-f0e7f12ebbb6534d97b6052531cf8ce2eb185739c213a148c1c76a429e6f4037)

Version 1.53.0 was released in Jun 29, 2022 on pypi
https://github.com/aws/aws-sam-cli/releases/tag/v1.53.0

Version 1.90.0 was released in Jul 6, 2023 on pypi
https://github.com/aws/aws-sam-cli/releases/tag/v1.90.0
2023-07-12 22:33:52 -03:00

65 lines
1.7 KiB
Nix

{ lib
, python3
, fetchPypi
, enableTelemetry ? false
}:
python3.pkgs.buildPythonApplication rec {
pname = "aws-sam-cli";
version = "1.90.0";
src = fetchPypi {
inherit pname version;
hash = "sha256-JXUfc37O6cTTOCTTtWE05m+GR4iDyBsmRPyXoTRxFmo=";
};
propagatedBuildInputs = with python3.pkgs; [
aws-lambda-builders
aws-sam-translator
boto3
cfn-lint
chevron
cookiecutter
dateparser
docker
flask
pyopenssl
pyyaml
rich
ruamel-yaml
serverlessrepo
tomlkit
typing-extensions
tzlocal
watchdog
];
postFixup = if enableTelemetry then "echo aws-sam-cli TELEMETRY IS ENABLED" else ''
# Disable telemetry: https://github.com/awslabs/aws-sam-cli/issues/1272
wrapProgram $out/bin/sam --set SAM_CLI_TELEMETRY 0
'';
postPatch = ''
substituteInPlace requirements/base.txt \
--replace 'PyYAML>=' 'PyYAML>=5.4.1 #' \
--replace 'aws-sam-translator==1.70.0' 'aws-sam-translator>=1.60.1' \
--replace 'boto3>=' 'boto3>=1.26.79 #' \
--replace 'cfn-lint~=0.77.9' 'cfn-lint~=0.73.2' \
--replace 'docker~=6.1.0' 'docker~=6.0.1' \
--replace 'pyopenssl~=23.2.0' 'pyopenssl~=23.1.0' \
--replace 'ruamel_yaml~=0.17.32' 'ruamel_yaml~=0.17.21' \
--replace 'tomlkit==0.11.8' 'tomlkit~=0.11.6' \
--replace 'typing_extensions~=4.4.0' 'typing_extensions~=4.4' \
--replace 'tzlocal==3.0' 'tzlocal>=3.0' \
--replace 'watchdog==' 'watchdog>=2.1.2 #'
'';
doCheck = false;
meta = with lib; {
homepage = "https://github.com/awslabs/aws-sam-cli";
description = "CLI tool for local development and testing of Serverless applications";
license = licenses.asl20;
maintainers = with maintainers; [ lo1tuma ];
};
}