1{
2 lib,
3 boto3,
4 buildPythonPackage,
5 fetchFromGitHub,
6 jsonschema,
7 parameterized,
8 pydantic,
9 pytest-env,
10 pytest-rerunfailures,
11 pytest-xdist,
12 pytestCheckHook,
13 pythonOlder,
14 pyyaml,
15 typing-extensions,
16}:
17
18buildPythonPackage rec {
19 pname = "aws-sam-translator";
20 version = "1.89.0";
21 format = "setuptools";
22
23 disabled = pythonOlder "3.7";
24
25 src = fetchFromGitHub {
26 owner = "aws";
27 repo = "serverless-application-model";
28 rev = "refs/tags/v${version}";
29 hash = "sha256-wqM3n99lD0s/E9nd55q19Us31XgFtU/bBYJR1HTnnvk=";
30 };
31
32 postPatch = ''
33 # don't try to use --cov or fail on new warnings
34 rm pytest.ini
35 '';
36
37 propagatedBuildInputs = [
38 boto3
39 jsonschema
40 pydantic
41 typing-extensions
42 ];
43
44 nativeCheckInputs = [
45 parameterized
46 pytest-env
47 pytest-rerunfailures
48 pytest-xdist
49 pytestCheckHook
50 pyyaml
51 ];
52
53 preCheck = ''
54 export AWS_DEFAULT_REGION=us-east-1
55 '';
56
57 pytestFlagsArray = [
58 "tests"
59 ''-m "not slow"''
60 ];
61
62 disabledTests = [
63 # urllib3 2.0 compat
64 "test_plugin_accepts_different_sar_client"
65 "test_plugin_accepts_flags"
66 "test_plugin_accepts_parameters"
67 "test_plugin_default_values"
68 "test_plugin_invalid_configuration_raises_exception"
69 "test_plugin_must_setup_correct_name"
70 "test_must_process_applications"
71 "test_must_process_applications_validate"
72 "test_process_invalid_applications"
73 "test_process_invalid_applications_validate"
74 "test_resolve_intrinsics"
75 "test_sar_service_calls"
76 "test_sar_success_one_app"
77 "test_sar_throttling_doesnt_stop_processing"
78 "test_sleep_between_sar_checks"
79 "test_unexpected_sar_error_stops_processing"
80 ];
81
82 __darwinAllowLocalNetworking = true;
83
84 pythonImportsCheck = [ "samtranslator" ];
85
86 meta = with lib; {
87 description = "Python library to transform SAM templates into AWS CloudFormation templates";
88 homepage = "https://github.com/aws/serverless-application-model";
89 changelog = "https://github.com/aws/serverless-application-model/releases/tag/v${version}";
90 license = licenses.asl20;
91 maintainers = [ ];
92 };
93}