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.37.0";
9
10 src = python3.pkgs.fetchPypi {
11 inherit pname version;
12 hash = "sha256-XE3g2mKwAiaJvi0ShVScnCKrmz7ujaQgOeFXuYwtP4g=";
13 };
14
15 propagatedBuildInputs = with python3.pkgs; [
16 aws-lambda-builders
17 aws-sam-translator
18 chevron
19 click
20 cookiecutter
21 dateparser
22 python-dateutil
23 docker
24 flask
25 jmespath
26 requests
27 serverlessrepo
28 tomlkit
29 watchdog
30 typing-extensions
31 regex
32 ];
33
34 postFixup = if enableTelemetry then "echo aws-sam-cli TELEMETRY IS ENABLED" else ''
35 # Disable telemetry: https://github.com/awslabs/aws-sam-cli/issues/1272
36 wrapProgram $out/bin/sam --set SAM_CLI_TELEMETRY 0
37 '';
38
39 # fix over-restrictive version bounds
40 postPatch = ''
41 substituteInPlace requirements/base.txt \
42 --replace "aws_lambda_builders==" "aws-lambda-builders #" \
43 --replace "click~=7.1" "click~=8.0" \
44 --replace "dateparser~=1.0" "dateparser>=0.7" \
45 --replace "docker~=4.2.0" "docker>=4.2.0" \
46 --replace "Flask~=1.1.2" "Flask~=2.0" \
47 --replace "jmespath~=0.10.0" "jmespath" \
48 --replace "PyYAML~=5.3" "PyYAML #" \
49 --replace "regex==" "regex #" \
50 --replace "requests==" "requests #" \
51 --replace "typing_extensions==" "typing-extensions #" \
52 --replace "tzlocal==3.0" "tzlocal #" \
53 --replace "tomlkit==0.7.2" "tomlkit #" \
54 --replace "watchdog==" "watchdog #"
55 '';
56
57 # Tests are not included in the PyPI package
58 doCheck = false;
59
60 meta = with lib; {
61 homepage = "https://github.com/awslabs/aws-sam-cli";
62 description = "CLI tool for local development and testing of Serverless applications";
63 license = licenses.asl20;
64 maintainers = with maintainers; [ lo1tuma ];
65 };
66}