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.

151 lines
3.3 KiB
Nix
Raw Normal View History

2021-02-16 22:22:49 +00:00
{ lib
2020-11-24 15:44:33 +00:00
, python3
, fetchFromGitHub
, git
, testers
, aws-sam-cli
, nix-update-script
, 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";
2024-02-07 08:10:26 +00:00
version = "1.108.0";
format = "pyproject";
2018-06-12 13:15:06 +00:00
disabled = python3.pythonOlder "3.8";
src = fetchFromGitHub {
owner = "aws";
repo = "aws-sam-cli";
rev = "refs/tags/v${version}";
2024-02-07 08:10:26 +00:00
hash = "sha256-k6SXCFkISyfr5/0vhe/Dfzs4qsVfu14lFx/bl53QxR4=";
2018-06-12 13:15:06 +00:00
};
nativeBuildInputs = with python3.pkgs; [
pythonRelaxDepsHook
2023-12-16 12:35:46 +00:00
setuptools
];
pythonRelaxDeps = [
"aws-sam-translator"
"boto3-stubs"
2024-02-07 08:10:26 +00:00
"cfn-lint"
"tzlocal"
2023-12-16 12:35:46 +00:00
"cookiecutter"
"docker"
"aws-lambda-builders"
"tomlkit"
"rich"
"jsonschema"
];
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
boto3
boto3-stubs
cfn-lint
2019-04-08 10:16:39 +00:00
chevron
click
2018-06-12 13:15:06 +00:00
cookiecutter
2018-07-30 06:23:44 +00:00
dateparser
2018-06-12 13:15:06 +00:00
docker
flask
jsonschema
pyopenssl
pyyaml
requests
rich
ruamel-yaml
2019-11-26 20:26:28 +00:00
tomlkit
typing-extensions
tzlocal
watchdog
] ++ (with python3.pkgs.boto3-stubs.optional-dependencies; [
apigateway
cloudformation
ecr
iam
kinesis
lambda
s3
schemas
secretsmanager
signer
sqs
stepfunctions
sts
xray
]);
2018-06-12 13:15:06 +00:00
postFixup = ''
2023-10-23 15:52:33 +00:00
# Disable telemetry: https://github.com/aws/aws-sam-cli/issues/1272
wrapProgram $out/bin/sam \
--set SAM_CLI_TELEMETRY ${if enableTelemetry then "1" else "0"} \
--prefix PATH : $out/bin:${lib.makeBinPath [ git ]}
'';
doCheck = true;
nativeCheckInputs = with python3.pkgs; [
filelock
flaky
parameterized
psutil
2024-02-07 08:10:26 +00:00
pytest-timeout
pytest-xdist
pytestCheckHook
];
preCheck = ''
export HOME=$(mktemp -d)
export PATH="$PATH:$out/bin:${lib.makeBinPath [ git ]}"
2019-05-24 15:22:13 +00:00
'';
pytestFlagsArray = [
"tests"
# Disable tests that requires networking or complex setup
"--ignore=tests/end_to_end"
"--ignore=tests/integration"
"--ignore=tests/regression"
"--ignore=tests/smoke"
"--ignore=tests/unit/lib/telemetry"
# Disable flaky tests
"--ignore=tests/unit/lib/samconfig/test_samconfig.py"
"--deselect=tests/unit/lib/sync/flows/test_rest_api_sync_flow.py::TestRestApiSyncFlow::test_update_stage"
"--deselect=tests/unit/lib/sync/flows/test_rest_api_sync_flow.py::TestRestApiSyncFlow::test_delete_deployment"
"--deselect=tests/unit/local/lambda_service/test_local_lambda_invoke_service.py::TestValidateRequestHandling::test_request_with_no_data"
# Disable warnings
"-W ignore::DeprecationWarning"
];
pythonImportsCheck = [
"samcli"
];
2022-01-13 10:14:14 +00:00
passthru = {
tests.version = testers.testVersion {
package = aws-sam-cli;
command = "sam --version";
};
updateScript = nix-update-script {
extraArgs = [ "--version-regex" "^v([0-9.]+)$" ];
};
};
__darwinAllowLocalNetworking = true;
2018-06-12 13:15:06 +00:00
meta = with lib; {
description = "CLI tool for local development and testing of Serverless applications";
2023-10-23 15:52:33 +00:00
homepage = "https://github.com/aws/aws-sam-cli";
2023-08-26 13:12:09 +00:00
changelog = "https://github.com/aws/aws-sam-cli/releases/tag/v${version}";
2018-06-12 13:15:06 +00:00
license = licenses.asl20;
2023-10-23 15:52:16 +00:00
mainProgram = "sam";
maintainers = with maintainers; [ lo1tuma anthonyroussel ];
2018-06-12 13:15:06 +00:00
};
}