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