nixpkgs/pkgs/development/tools/aws-sam-cli/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

81 lines
2.4 KiB
Nix
Raw Normal View History

2021-02-16 22:22:49 +00:00
{ lib
2020-11-24 15:44:33 +00:00
, python3
, enableTelemetry ? false
2018-06-12 13:15:06 +00:00
}:
2020-11-24 16:22:13 +00:00
python3.pkgs.buildPythonApplication rec {
2018-06-12 13:15:06 +00:00
pname = "aws-sam-cli";
2022-07-18 17:29:07 +00:00
version = "1.53.0";
2018-06-12 13:15:06 +00:00
2020-11-24 16:22:13 +00:00
src = python3.pkgs.fetchPypi {
2018-06-12 13:15:06 +00:00
inherit pname version;
2022-07-18 17:29:07 +00:00
hash = "sha256-kIW+aGYuS+JgOMsPbeLgPSgLFNKLSqHaZ1CHpjs/IVI=";
2018-06-12 13:15:06 +00:00
};
2020-11-24 16:22:13 +00:00
propagatedBuildInputs = with python3.pkgs; [
2019-04-08 10:16:39 +00:00
aws-lambda-builders
2018-06-12 13:15:06 +00:00
aws-sam-translator
2019-04-08 10:16:39 +00:00
chevron
2018-06-12 13:15:06 +00:00
click
cookiecutter
2018-07-30 06:23:44 +00:00
dateparser
2020-11-24 16:22:13 +00:00
python-dateutil
2018-06-12 13:15:06 +00:00
docker
flask
2020-03-18 18:43:56 +00:00
jmespath
2019-04-08 10:16:39 +00:00
requests
serverlessrepo
2019-11-26 20:26:28 +00:00
tomlkit
2020-11-24 16:22:13 +00:00
watchdog
typing-extensions
regex
2018-06-12 13:15:06 +00:00
];
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
'';
2022-06-20 04:29:49 +00:00
patches = [
# Click 8.1 removed `get_terminal_size`, recommending
# `shutil.get_terminal_size` instead.
# (https://github.com/pallets/click/pull/2130)
./support-click-8-1.patch
# Werkzeug >= 2.1.0 breaks the `sam local start-lambda` command because
# aws-sam-cli uses a "WERKZEUG_RUN_MAIN" hack to suppress flask output.
# (https://github.com/cs01/gdbgui/issues/425)
./use_forward_compatible_log_silencing.patch
2022-06-20 04:29:49 +00:00
];
2019-10-17 21:45:52 +00:00
# fix over-restrictive version bounds
2019-05-24 15:22:13 +00:00
postPatch = ''
2019-12-10 07:01:59 +00:00
substituteInPlace requirements/base.txt \
2022-01-13 10:14:14 +00:00
--replace "aws_lambda_builders==" "aws-lambda-builders #" \
2022-07-18 17:29:07 +00:00
--replace "aws-sam-translator==1.46.0" "aws-sam-translator~=1.46" \
2022-06-20 04:29:49 +00:00
--replace "click~=7.1" "click~=8.1" \
--replace "cookiecutter~=1.7.2" "cookiecutter>=1.7.2" \
--replace "dateparser~=1.0" "dateparser>=0.7" \
2020-11-24 16:22:13 +00:00
--replace "docker~=4.2.0" "docker>=4.2.0" \
2022-07-18 17:29:07 +00:00
--replace "Flask~=1.1.4" "Flask~=2.0" \
--replace "jmespath~=0.10.0" "jmespath" \
2022-06-20 04:29:49 +00:00
--replace "MarkupSafe==2.0.1" "MarkupSafe #" \
2022-01-20 08:46:05 +00:00
--replace "PyYAML~=5.3" "PyYAML #" \
2022-01-13 10:14:14 +00:00
--replace "regex==" "regex #" \
--replace "requests==" "requests #" \
--replace "typing_extensions==" "typing-extensions #" \
2022-01-20 08:46:05 +00:00
--replace "tzlocal==3.0" "tzlocal #" \
--replace "tomlkit==0.7.2" "tomlkit #" \
2022-01-13 10:14:14 +00:00
--replace "watchdog==" "watchdog #"
2019-05-24 15:22:13 +00:00
'';
2022-01-13 10:14:14 +00:00
# Tests are not included in the PyPI package
doCheck = false;
2018-06-12 13:15:06 +00:00
meta = with lib; {
homepage = "https://github.com/awslabs/aws-sam-cli";
2018-06-12 13:15:06 +00:00
description = "CLI tool for local development and testing of Serverless applications";
license = licenses.asl20;
maintainers = with maintainers; [ lo1tuma ];
2018-06-12 13:15:06 +00:00
};
}