aws-sam-cli: refactor (#343891)

This commit is contained in:
Fabian Affolter 2024-09-23 12:39:05 +02:00 committed by GitHub
commit 6bab3e1724
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,11 +1,12 @@
{ lib {
, python3 lib,
, fetchFromGitHub python3,
, git fetchFromGitHub,
, testers git,
, aws-sam-cli testers,
, nix-update-script aws-sam-cli,
, enableTelemetry ? false nix-update-script,
enableTelemetry ? false,
}: }:
python3.pkgs.buildPythonApplication rec { python3.pkgs.buildPythonApplication rec {
@ -13,8 +14,6 @@ python3.pkgs.buildPythonApplication rec {
version = "1.120.0"; version = "1.120.0";
pyproject = true; pyproject = true;
disabled = python3.pythonOlder "3.8";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "aws"; owner = "aws";
repo = "aws-sam-cli"; repo = "aws-sam-cli";
@ -22,9 +21,7 @@ python3.pkgs.buildPythonApplication rec {
hash = "sha256-XFVh7e9ooIBhWRkVovPdrSuyosBMQ84PDRjV2o0x9ns="; hash = "sha256-XFVh7e9ooIBhWRkVovPdrSuyosBMQ84PDRjV2o0x9ns=";
}; };
build-system = with python3.pkgs; [ build-system = with python3.pkgs; [ setuptools ];
setuptools
];
pythonRelaxDeps = [ pythonRelaxDeps = [
"aws-lambda-builders" "aws-lambda-builders"
@ -43,44 +40,47 @@ python3.pkgs.buildPythonApplication rec {
"watchdog" "watchdog"
]; ];
dependencies = with python3.pkgs; [ dependencies =
aws-lambda-builders with python3.pkgs;
aws-sam-translator [
boto3 aws-lambda-builders
boto3-stubs aws-sam-translator
cfn-lint boto3
chevron boto3-stubs
click cfn-lint
cookiecutter chevron
dateparser click
docker cookiecutter
flask dateparser
jsonschema docker
pyopenssl flask
pyyaml jsonschema
requests pyopenssl
rich pyyaml
ruamel-yaml requests
tomlkit rich
typing-extensions ruamel-yaml
tzlocal tomlkit
watchdog typing-extensions
] ++ (with python3.pkgs.boto3-stubs.optional-dependencies; [ tzlocal
apigateway watchdog
cloudformation ]
ecr ++ (with python3.pkgs.boto3-stubs.optional-dependencies; [
iam apigateway
kinesis cloudformation
lambda ecr
s3 iam
schemas kinesis
secretsmanager lambda
signer s3
sqs schemas
stepfunctions secretsmanager
sts signer
xray sqs
]); stepfunctions
sts
xray
]);
postFixup = '' postFixup = ''
# Disable telemetry: https://github.com/aws/aws-sam-cli/issues/1272 # Disable telemetry: https://github.com/aws/aws-sam-cli/issues/1272
@ -92,6 +92,7 @@ python3.pkgs.buildPythonApplication rec {
nativeCheckInputs = with python3.pkgs; [ nativeCheckInputs = with python3.pkgs; [
filelock filelock
flaky flaky
jaraco-text
parameterized parameterized
psutil psutil
pytest-timeout pytest-timeout
@ -133,9 +134,7 @@ python3.pkgs.buildPythonApplication rec {
"test_import_should_succeed_for_a_defined_hidden_package_540_pkg_resources_py2_warn" "test_import_should_succeed_for_a_defined_hidden_package_540_pkg_resources_py2_warn"
]; ];
pythonImportsCheck = [ pythonImportsCheck = [ "samcli" ];
"samcli"
];
passthru = { passthru = {
tests.version = testers.testVersion { tests.version = testers.testVersion {
@ -143,7 +142,10 @@ python3.pkgs.buildPythonApplication rec {
command = "sam --version"; command = "sam --version";
}; };
updateScript = nix-update-script { updateScript = nix-update-script {
extraArgs = [ "--version-regex" "^v([0-9.]+)$" ]; extraArgs = [
"--version-regex"
"^v([0-9.]+)$"
];
}; };
}; };
@ -155,6 +157,9 @@ python3.pkgs.buildPythonApplication rec {
changelog = "https://github.com/aws/aws-sam-cli/releases/tag/v${version}"; changelog = "https://github.com/aws/aws-sam-cli/releases/tag/v${version}";
license = licenses.asl20; license = licenses.asl20;
mainProgram = "sam"; mainProgram = "sam";
maintainers = with maintainers; [ lo1tuma anthonyroussel ]; maintainers = with maintainers; [
lo1tuma
anthonyroussel
];
}; };
} }