Merge pull request #249774 from anthonyroussel/aws-sam-cli_1_95_0

aws-sam-cli: 1.90.0 -> 1.103.0

authored by Mario Rodas and committed by GitHub deb11327 343f9a8f

+101 -27
+101 -27
pkgs/development/tools/aws-sam-cli/default.nix
··· 1 { lib 2 , python3 3 - , fetchPypi 4 , enableTelemetry ? false 5 }: 6 7 python3.pkgs.buildPythonApplication rec { 8 pname = "aws-sam-cli"; 9 - version = "1.90.0"; 10 11 - src = fetchPypi { 12 - inherit pname version; 13 - hash = "sha256-JXUfc37O6cTTOCTTtWE05m+GR4iDyBsmRPyXoTRxFmo="; 14 }; 15 16 propagatedBuildInputs = with python3.pkgs; [ 17 aws-lambda-builders 18 aws-sam-translator 19 boto3 20 cfn-lint 21 chevron 22 cookiecutter 23 dateparser 24 docker 25 flask 26 pyopenssl 27 pyyaml 28 rich 29 ruamel-yaml 30 - serverlessrepo 31 tomlkit 32 typing-extensions 33 tzlocal 34 watchdog 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 - postPatch = '' 43 - substituteInPlace requirements/base.txt \ 44 - --replace 'PyYAML>=' 'PyYAML>=5.4.1 #' \ 45 - --replace "aws_lambda_builders==" "aws_lambda_builders>=" \ 46 - --replace 'aws-sam-translator==1.70.0' 'aws-sam-translator>=1.60.1' \ 47 - --replace 'boto3>=' 'boto3>=1.26.79 #' \ 48 - --replace 'cfn-lint~=0.77.9' 'cfn-lint~=0.73.2' \ 49 - --replace "cookiecutter~=" "cookiecutter>=" \ 50 - --replace 'docker~=6.1.0' 'docker~=6.0.1' \ 51 - --replace 'ruamel_yaml~=0.17.32' 'ruamel_yaml~=0.17.21' \ 52 - --replace 'tomlkit==0.11.8' 'tomlkit>=0.11.8' \ 53 - --replace 'typing_extensions~=4.4.0' 'typing_extensions~=4.4' \ 54 - --replace 'tzlocal==3.0' 'tzlocal>=3.0' \ 55 - --replace 'watchdog==' 'watchdog>=2.1.2 #' 56 ''; 57 58 - doCheck = false; 59 60 meta = with lib; { 61 description = "CLI tool for local development and testing of Serverless applications"; 62 - homepage = "https://github.com/awslabs/aws-sam-cli"; 63 changelog = "https://github.com/aws/aws-sam-cli/releases/tag/v${version}"; 64 license = licenses.asl20; 65 - maintainers = with maintainers; [ lo1tuma ]; 66 }; 67 }
··· 1 { lib 2 , python3 3 + , fetchFromGitHub 4 + , git 5 + , testers 6 + , aws-sam-cli 7 + , nix-update-script 8 , enableTelemetry ? false 9 }: 10 11 python3.pkgs.buildPythonApplication rec { 12 pname = "aws-sam-cli"; 13 + version = "1.103.0"; 14 + format = "pyproject"; 15 16 + disabled = python3.pythonOlder "3.8"; 17 + 18 + src = fetchFromGitHub { 19 + owner = "aws"; 20 + repo = "aws-sam-cli"; 21 + rev = "refs/tags/v${version}"; 22 + hash = "sha256-oy0+dAA6x8Jl1nZ1wjsR9xvpR9biemTtqL9B1awz4BM="; 23 }; 24 25 + nativeBuildInputs = with python3.pkgs; [ 26 + pythonRelaxDepsHook 27 + ]; 28 + 29 + pythonRelaxDeps = [ 30 + "aws-sam-translator" 31 + "boto3-stubs" 32 + "tzlocal" 33 + ]; 34 + 35 propagatedBuildInputs = with python3.pkgs; [ 36 aws-lambda-builders 37 aws-sam-translator 38 boto3 39 + boto3-stubs 40 cfn-lint 41 chevron 42 + click 43 cookiecutter 44 dateparser 45 docker 46 flask 47 + jsonschema 48 pyopenssl 49 pyyaml 50 + requests 51 rich 52 ruamel-yaml 53 tomlkit 54 typing-extensions 55 tzlocal 56 watchdog 57 + ] ++ (with python3.pkgs.boto3-stubs.optional-dependencies; [ 58 + apigateway 59 + cloudformation 60 + ecr 61 + iam 62 + kinesis 63 + lambda 64 + s3 65 + schemas 66 + secretsmanager 67 + signer 68 + sqs 69 + stepfunctions 70 + sts 71 + xray 72 + ]); 73 74 + postFixup = '' 75 + # Disable telemetry: https://github.com/aws/aws-sam-cli/issues/1272 76 + wrapProgram $out/bin/sam \ 77 + --set SAM_CLI_TELEMETRY ${if enableTelemetry then "1" else "0"} \ 78 + --prefix PATH : $out/bin:${lib.makeBinPath [ git ]} 79 ''; 80 81 + doCheck = true; 82 + 83 + nativeCheckInputs = with python3.pkgs; [ 84 + filelock 85 + flaky 86 + parameterized 87 + psutil 88 + pytest-xdist 89 + pytestCheckHook 90 + ]; 91 + 92 + preCheck = '' 93 + export HOME=$(mktemp -d) 94 + export PATH="$PATH:$out/bin:${lib.makeBinPath [ git ]}" 95 ''; 96 97 + pytestFlagsArray = [ 98 + "tests" 99 + 100 + # Disable tests that requires networking or complex setup 101 + "--ignore=tests/end_to_end" 102 + "--ignore=tests/integration" 103 + "--ignore=tests/regression" 104 + "--ignore=tests/smoke" 105 + "--ignore=tests/unit/lib/telemetry" 106 + 107 + # Disable flaky tests 108 + "--ignore=tests/unit/lib/samconfig/test_samconfig.py" 109 + "--deselect=tests/unit/lib/sync/flows/test_rest_api_sync_flow.py::TestRestApiSyncFlow::test_update_stage" 110 + "--deselect=tests/unit/lib/sync/flows/test_rest_api_sync_flow.py::TestRestApiSyncFlow::test_delete_deployment" 111 + "--deselect=tests/unit/local/lambda_service/test_local_lambda_invoke_service.py::TestValidateRequestHandling::test_request_with_no_data" 112 + 113 + # Disable warnings 114 + "-W ignore::DeprecationWarning" 115 + ]; 116 + 117 + pythonImportsCheck = [ 118 + "samcli" 119 + ]; 120 + 121 + passthru = { 122 + tests.version = testers.testVersion { 123 + package = aws-sam-cli; 124 + command = "sam --version"; 125 + }; 126 + updateScript = nix-update-script { 127 + extraArgs = [ "--version-regex" "^v([0-9.]+)$" ]; 128 + }; 129 + }; 130 + 131 + __darwinAllowLocalNetworking = true; 132 133 meta = with lib; { 134 description = "CLI tool for local development and testing of Serverless applications"; 135 + homepage = "https://github.com/aws/aws-sam-cli"; 136 changelog = "https://github.com/aws/aws-sam-cli/releases/tag/v${version}"; 137 license = licenses.asl20; 138 + mainProgram = "sam"; 139 + maintainers = with maintainers; [ lo1tuma anthonyroussel ]; 140 }; 141 }