nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, boto3
3, buildPythonPackage
4, fetchFromGitHub
5, jsonschema
6, mock
7, parameterized
8, pytestCheckHook
9, pythonOlder
10, pyyaml
11, six
12}:
13
14buildPythonPackage rec {
15 pname = "aws-sam-translator";
16 version = "1.42.0";
17 format = "setuptools";
18
19 disabled = pythonOlder "3.6";
20
21 src = fetchFromGitHub {
22 owner = "aws";
23 repo = "serverless-application-model";
24 rev = "v${version}";
25 sha256 = "sha256-pjcRsmxPL4lbgDopW+wKQRkRcqebLPTd95JTL8PiWtc=";
26 };
27
28 propagatedBuildInputs = [
29 boto3
30 jsonschema
31 six
32 ];
33
34 postPatch = ''
35 substituteInPlace requirements/base.txt \
36 --replace "jsonschema~=3.2" "jsonschema>=3.2"
37 substituteInPlace pytest.ini \
38 --replace " --cov samtranslator --cov-report term-missing --cov-fail-under 95" ""
39 '';
40
41 checkInputs = [
42 mock
43 parameterized
44 pytestCheckHook
45 pyyaml
46 ];
47
48 disabledTests = [
49 # AssertionError: Expected 7 errors, found 9:
50 "test_errors_13_error_definitionuri"
51 ];
52
53 pythonImportsCheck = [
54 "samtranslator"
55 ];
56
57 meta = with lib; {
58 description = "Python library to transform SAM templates into AWS CloudFormation templates";
59 homepage = "https://github.com/awslabs/serverless-application-model";
60 license = licenses.asl20;
61 maintainers = with maintainers; [ ];
62 };
63}