2021-02-17 17:02:09 +00:00
|
|
|
{ lib
|
2020-11-30 08:33:03 +00:00
|
|
|
, python3
|
2024-01-02 11:29:13 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, git
|
|
|
|
, testers
|
|
|
|
, aws-sam-cli
|
|
|
|
, nix-update-script
|
2020-04-24 23:36:52 +00:00
|
|
|
, enableTelemetry ? false
|
|
|
|
}:
|
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
python3.pkgs.buildPythonApplication rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "aws-sam-cli";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "1.120.0";
|
2024-02-29 20:09:43 +00:00
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
disabled = python3.pythonOlder "3.8";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "aws";
|
|
|
|
repo = "aws-sam-cli";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-XFVh7e9ooIBhWRkVovPdrSuyosBMQ84PDRjV2o0x9ns=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = with python3.pkgs; [
|
2024-01-13 08:15:51 +00:00
|
|
|
setuptools
|
2024-01-02 11:29:13 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonRelaxDeps = [
|
2024-02-29 20:09:43 +00:00
|
|
|
"aws-lambda-builders"
|
2024-01-02 11:29:13 +00:00
|
|
|
"aws-sam-translator"
|
|
|
|
"boto3-stubs"
|
2024-02-29 20:09:43 +00:00
|
|
|
"cfn-lint"
|
2024-01-13 08:15:51 +00:00
|
|
|
"cookiecutter"
|
|
|
|
"docker"
|
|
|
|
"jsonschema"
|
2024-02-29 20:09:43 +00:00
|
|
|
"pyopenssl"
|
2024-06-20 14:57:18 +00:00
|
|
|
"requests"
|
2024-02-29 20:09:43 +00:00
|
|
|
"rich"
|
|
|
|
"ruamel-yaml"
|
|
|
|
"tomlkit"
|
|
|
|
"tzlocal"
|
2024-06-20 14:57:18 +00:00
|
|
|
"watchdog"
|
2024-01-02 11:29:13 +00:00
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = with python3.pkgs; [
|
2020-04-24 23:36:52 +00:00
|
|
|
aws-lambda-builders
|
|
|
|
aws-sam-translator
|
2023-07-15 17:15:38 +00:00
|
|
|
boto3
|
2024-01-02 11:29:13 +00:00
|
|
|
boto3-stubs
|
2023-07-15 17:15:38 +00:00
|
|
|
cfn-lint
|
2020-04-24 23:36:52 +00:00
|
|
|
chevron
|
2024-01-02 11:29:13 +00:00
|
|
|
click
|
2020-04-24 23:36:52 +00:00
|
|
|
cookiecutter
|
|
|
|
dateparser
|
|
|
|
docker
|
|
|
|
flask
|
2024-01-02 11:29:13 +00:00
|
|
|
jsonschema
|
2023-07-15 17:15:38 +00:00
|
|
|
pyopenssl
|
|
|
|
pyyaml
|
2024-01-02 11:29:13 +00:00
|
|
|
requests
|
2023-07-15 17:15:38 +00:00
|
|
|
rich
|
|
|
|
ruamel-yaml
|
2020-04-24 23:36:52 +00:00
|
|
|
tomlkit
|
2021-12-06 16:07:01 +00:00
|
|
|
typing-extensions
|
2023-07-15 17:15:38 +00:00
|
|
|
tzlocal
|
|
|
|
watchdog
|
2024-01-02 11:29:13 +00:00
|
|
|
] ++ (with python3.pkgs.boto3-stubs.optional-dependencies; [
|
|
|
|
apigateway
|
|
|
|
cloudformation
|
|
|
|
ecr
|
|
|
|
iam
|
|
|
|
kinesis
|
|
|
|
lambda
|
|
|
|
s3
|
|
|
|
schemas
|
|
|
|
secretsmanager
|
|
|
|
signer
|
|
|
|
sqs
|
|
|
|
stepfunctions
|
|
|
|
sts
|
|
|
|
xray
|
|
|
|
]);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
postFixup = ''
|
|
|
|
# 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 ]}
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
nativeCheckInputs = with python3.pkgs; [
|
|
|
|
filelock
|
|
|
|
flaky
|
|
|
|
parameterized
|
|
|
|
psutil
|
2024-02-29 20:09:43 +00:00
|
|
|
pytest-timeout
|
2024-01-02 11:29:13 +00:00
|
|
|
pytest-xdist
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
export PATH="$PATH:$out/bin:${lib.makeBinPath [ git ]}"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"tests"
|
2024-02-29 20:09:43 +00:00
|
|
|
# Disable warnings
|
|
|
|
"-W"
|
|
|
|
"ignore::DeprecationWarning"
|
|
|
|
];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
disabledTestPaths = [
|
2024-01-02 11:29:13 +00:00
|
|
|
# Disable tests that requires networking or complex setup
|
2024-02-29 20:09:43 +00:00
|
|
|
"tests/end_to_end"
|
|
|
|
"tests/integration"
|
|
|
|
"tests/regression"
|
|
|
|
"tests/smoke"
|
|
|
|
"tests/unit/lib/telemetry"
|
2024-07-27 06:49:29 +00:00
|
|
|
"tests/unit/hook_packages/terraform/hooks/prepare/"
|
|
|
|
"tests/unit/lib/observability/cw_logs/"
|
|
|
|
"tests/unit/lib/build_module/"
|
2024-01-02 11:29:13 +00:00
|
|
|
# Disable flaky tests
|
2024-02-29 20:09:43 +00:00
|
|
|
"tests/unit/lib/samconfig/test_samconfig.py"
|
|
|
|
];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
disabledTests = [
|
|
|
|
# Disable flaky tests
|
|
|
|
"test_update_stage"
|
|
|
|
"test_delete_deployment"
|
|
|
|
"test_request_with_no_data"
|
2024-01-02 11:29:13 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"samcli"
|
|
|
|
];
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
tests.version = testers.testVersion {
|
|
|
|
package = aws-sam-cli;
|
|
|
|
command = "sam --version";
|
|
|
|
};
|
|
|
|
updateScript = nix-update-script {
|
|
|
|
extraArgs = [ "--version-regex" "^v([0-9.]+)$" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
__darwinAllowLocalNetworking = true;
|
2022-01-13 20:06:32 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "CLI tool for local development and testing of Serverless applications";
|
2024-01-02 11:29:13 +00:00
|
|
|
homepage = "https://github.com/aws/aws-sam-cli";
|
2023-10-09 19:29:22 +00:00
|
|
|
changelog = "https://github.com/aws/aws-sam-cli/releases/tag/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "sam";
|
|
|
|
maintainers = with maintainers; [ lo1tuma anthonyroussel ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|