nixpkgs/pkgs/by-name/aw/aws-sam-cli/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

166 lines
3.3 KiB
Nix
Raw Normal View History

2024-08-18 07:18:06 +00:00
{
lib,
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";
version = "1.127.0";
2024-02-25 11:17:50 +00:00
pyproject = true;
2018-06-12 13:15:06 +00:00
src = fetchFromGitHub {
owner = "aws";
repo = "aws-sam-cli";
rev = "refs/tags/v${version}";
hash = "sha256-5/zXvO5xrNkhPCei4O/nMXA/e18VNrED2lpBbflaJLQ=";
2018-06-12 13:15:06 +00:00
};
2024-08-18 07:18:06 +00:00
build-system = with python3.pkgs; [ setuptools ];
pythonRelaxDeps = [
2024-02-25 11:17:50 +00:00
"aws-lambda-builders"
"aws-sam-translator"
"boto3-stubs"
2024-02-07 08:10:26 +00:00
"cfn-lint"
2023-12-16 12:35:46 +00:00
"cookiecutter"
"docker"
"jsonschema"
"pyopenssl"
"requests"
2024-02-25 11:17:50 +00:00
"rich"
"ruamel-yaml"
2024-02-25 11:17:50 +00:00
"tomlkit"
"tzlocal"
"watchdog"
];
2024-08-18 07:18:06 +00:00
dependencies =
with python3.pkgs;
[
aws-lambda-builders
aws-sam-translator
boto3
boto3-stubs
cfn-lint
chevron
click
cookiecutter
dateparser
docker
flask
jsonschema
pyopenssl
pyyaml
requests
rich
ruamel-yaml
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 ]}
'';
nativeCheckInputs = with python3.pkgs; [
filelock
flaky
jaraco-text
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"
2024-02-25 11:17:50 +00:00
# Disable warnings
"-W"
"ignore::DeprecationWarning"
];
2024-02-25 11:17:50 +00:00
disabledTestPaths = [
# Disable tests that requires networking or complex setup
2024-02-25 11:17:50 +00:00
"tests/end_to_end"
"tests/integration"
"tests/regression"
"tests/smoke"
"tests/unit/lib/telemetry"
"tests/unit/hook_packages/terraform/hooks/prepare/"
"tests/unit/lib/observability/cw_logs/"
"tests/unit/lib/build_module/"
# Disable flaky tests
2024-02-25 11:17:50 +00:00
"tests/unit/lib/samconfig/test_samconfig.py"
];
2024-02-25 11:17:50 +00:00
disabledTests = [
# Disable flaky tests
"test_update_stage"
"test_delete_deployment"
"test_request_with_no_data"
2024-09-03 23:31:15 +00:00
"test_import_should_succeed_for_a_defined_hidden_package_540_pkg_resources_py2_warn"
];
2024-08-18 07:18:06 +00:00
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 {
2024-08-18 07:18:06 +00:00
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";
2024-08-18 07:18:06 +00:00
maintainers = with maintainers; [
lo1tuma
anthonyroussel
];
2018-06-12 13:15:06 +00:00
};
}