about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/aws-sam-cli/default.nix
blob: 32b7ba5a178442fe0671096f54e0d62ba1e2a419 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{ 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 'ruamel_yaml~=0.17.32' 'ruamel_yaml~=0.17.21' \
      --replace 'tomlkit==0.11.8' 'tomlkit>=0.11.8' \
      --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 ];
  };
}