2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, boto3
|
2021-08-25 08:27:29 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2023-03-15 16:39:30 +00:00
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, jsonschema
|
2021-08-25 08:27:29 +00:00
|
|
|
, mock
|
|
|
|
, parameterized
|
2023-01-20 10:41:00 +00:00
|
|
|
, pydantic
|
2022-07-14 12:49:19 +00:00
|
|
|
, pytest-env
|
2023-01-20 10:41:00 +00:00
|
|
|
, pytest-rerunfailures
|
|
|
|
, pytest-xdist
|
2021-08-25 08:27:29 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, pyyaml
|
2023-01-20 10:41:00 +00:00
|
|
|
, typing-extensions
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "aws-sam-translator";
|
2023-03-15 16:39:30 +00:00
|
|
|
version = "1.60.1";
|
2022-02-10 20:34:41 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-25 08:27:29 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "aws";
|
|
|
|
repo = "serverless-application-model";
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-exVB1STX8OsFnQ0pzSuR3O/FrvG2GR5MdZa8tZ9IJvI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
boto3
|
|
|
|
jsonschema
|
2023-01-20 10:41:00 +00:00
|
|
|
pydantic
|
|
|
|
typing-extensions
|
2021-08-25 08:27:29 +00:00
|
|
|
];
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
# relax typing-extenions dependency
|
|
|
|
url = "https://github.com/aws/serverless-application-model/commit/d1c26f7ad9510a238ba570d511d5807a81379d0a.patch";
|
|
|
|
hash = "sha256-nh6MtRgi0RrC8xLkLbU6/Ec0kYtxIG/fgjn/KLiAM0E=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-08-25 08:27:29 +00:00
|
|
|
postPatch = ''
|
2022-02-10 20:34:41 +00:00
|
|
|
substituteInPlace requirements/base.txt \
|
|
|
|
--replace "jsonschema~=3.2" "jsonschema>=3.2"
|
2021-08-25 08:27:29 +00:00
|
|
|
substituteInPlace pytest.ini \
|
|
|
|
--replace " --cov samtranslator --cov-report term-missing --cov-fail-under 95" ""
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-08-25 08:27:29 +00:00
|
|
|
parameterized
|
2022-07-14 12:49:19 +00:00
|
|
|
pytest-env
|
2023-01-20 10:41:00 +00:00
|
|
|
pytest-rerunfailures
|
|
|
|
pytest-xdist
|
2021-08-25 08:27:29 +00:00
|
|
|
pytestCheckHook
|
|
|
|
pyyaml
|
|
|
|
];
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
doCheck = false; # tests fail in weird ways
|
2023-01-20 10:41:00 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"samtranslator"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Python library to transform SAM templates into AWS CloudFormation templates";
|
2021-08-25 08:27:29 +00:00
|
|
|
homepage = "https://github.com/awslabs/serverless-application-model";
|
2021-02-13 14:23:35 +00:00
|
|
|
license = licenses.asl20;
|
2021-08-25 08:27:29 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|