python3Packages.aws-sam-translator: enable tests

This commit is contained in:
Fabian Affolter 2021-08-23 09:30:12 +02:00
parent e1fb0c6afb
commit f2393771a6

View File

@ -1,10 +1,14 @@
{ lib
, buildPythonPackage
, fetchPypi
, pythonOlder
, boto3
, buildPythonPackage
, enum34
, fetchFromGitHub
, jsonschema
, mock
, parameterized
, pytestCheckHook
, pythonOlder
, pyyaml
, six
}:
@ -12,23 +16,39 @@ buildPythonPackage rec {
pname = "aws-sam-translator";
version = "1.38.0";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-Dsrdqc9asjGPV/ElMYGiFR5MU8010hcXqSPAdaWmXLY=";
src = fetchFromGitHub {
owner = "aws";
repo = "serverless-application-model";
rev = "v${version}";
sha256 = "0nn9jfqz13kzmxm0r9vy24p8sqxv3mrm5d3lx7ah6rc581q8nv1k";
};
# Tests are not included in the PyPI package
doCheck = false;
propagatedBuildInputs = [
boto3
jsonschema
six
] ++ lib.optionals (pythonOlder "3.4") [ enum34 ];
] ++ lib.optionals (pythonOlder "3.4") [
enum34
];
postPatch = ''
substituteInPlace pytest.ini \
--replace " --cov samtranslator --cov-report term-missing --cov-fail-under 95" ""
'';
checkInputs = [
mock
parameterized
pytestCheckHook
pyyaml
];
pythonImportsCheck = [ "samtranslator" ];
meta = with lib; {
homepage = "https://github.com/awslabs/serverless-application-model";
description = "Python library to transform SAM templates into AWS CloudFormation templates";
homepage = "https://github.com/awslabs/serverless-application-model";
license = licenses.asl20;
maintainers = with maintainers; [ ];
};
}