nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, python3
3, enableTelemetry ? false
4}:
5
6python3.pkgs.buildPythonApplication rec {
7 pname = "aws-sam-cli";
8 version = "1.35.0";
9
10 src = python3.pkgs.fetchPypi {
11 inherit pname version;
12 sha256 = "sha256-ojJoC8UuZDVm6CDmYbPoO0e+1QAYa0UcekYEd/MGFRM=";
13 };
14
15 # Tests are not included in the PyPI package
16 doCheck = false;
17
18 propagatedBuildInputs = with python3.pkgs; [
19 aws-lambda-builders
20 aws-sam-translator
21 chevron
22 click
23 cookiecutter
24 dateparser
25 python-dateutil
26 docker
27 flask
28 jmespath
29 requests
30 serverlessrepo
31 tomlkit
32 watchdog
33 typing-extensions
34 regex
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 # fix over-restrictive version bounds
43 postPatch = ''
44 substituteInPlace requirements/base.txt \
45 --replace "click~=7.1" "click~=8.0" \
46 --replace "Flask~=1.1.2" "Flask~=2.0" \
47 --replace "dateparser~=1.0" "dateparser>=0.7" \
48 --replace "docker~=4.2.0" "docker>=4.2.0" \
49 --replace "requests==" "requests #" \
50 --replace "watchdog==" "watchdog #" \
51 --replace "aws_lambda_builders==" "aws-lambda-builders #" \
52 --replace "typing_extensions==" "typing-extensions #" \
53 --replace "regex==" "regex #" \
54 --replace "tzlocal==3.0" "tzlocal==2.*"
55 '';
56
57 meta = with lib; {
58 homepage = "https://github.com/awslabs/aws-sam-cli";
59 description = "CLI tool for local development and testing of Serverless applications";
60 license = licenses.asl20;
61 maintainers = with maintainers; [ lo1tuma ];
62 };
63}