1{ lib
2, stdenv
3, buildPythonPackage
4, fetchPypi
5, pythonOlder
6
7# build
8, setuptools
9
10# runtime
11, aws-xray-sdk
12, boto3
13, botocore
14, cfn-lint
15, cryptography
16, docker
17, flask
18, flask-cors
19, graphql-core
20, idna
21, jinja2
22, jsondiff
23, openapi-spec-validator
24, pyparsing
25, python-dateutil
26, python-jose
27, pyyaml
28, requests
29, responses
30, sshpubkeys
31, werkzeug
32, xmltodict
33
34# tests
35, freezegun
36, pytestCheckHook
37, pytest-xdist
38, sure
39}:
40
41buildPythonPackage rec {
42 pname = "moto";
43 version = "4.1.3";
44 format = "pyproject";
45
46 disabled = pythonOlder "3.6";
47
48 src = fetchPypi {
49 inherit pname version;
50 hash = "sha256-yCAMyqlEDC6dqgvV4L12inGdtaLILqjXgvDj+gmjxeI=";
51 };
52
53 nativeBuildInputs = [
54 setuptools
55 ];
56
57 propagatedBuildInputs = [
58 aws-xray-sdk
59 boto3
60 botocore
61 cfn-lint
62 cryptography
63 docker
64 flask
65 flask-cors
66 graphql-core
67 idna
68 jinja2
69 jsondiff
70 openapi-spec-validator
71 pyparsing
72 python-dateutil
73 python-jose
74 pyyaml
75 requests
76 responses
77 sshpubkeys
78 werkzeug
79 xmltodict
80 ];
81
82 nativeCheckInputs = [
83 freezegun
84 pytestCheckHook
85 sure
86 ];
87
88 pytestFlagsArray = [
89 # Disable tests that try to access the network
90 "--deselect=tests/test_cloudformation/test_cloudformation_custom_resources.py::test_create_custom_lambda_resource__verify_cfnresponse_failed"
91 "--deselect=tests/test_cloudformation/test_server.py::test_cloudformation_server_get"
92 "--deselect=tests/test_core/test_decorator_calls.py::test_context_manager"
93 "--deselect=tests/test_core/test_decorator_calls.py::test_decorator_start_and_stop"
94 "--deselect=tests/test_core/test_request_mocking.py::test_passthrough_requests"
95 "--deselect=tests/test_firehose/test_firehose_put.py::test_put_record_batch_http_destination"
96 "--deselect=tests/test_firehose/test_firehose_put.py::test_put_record_http_destination"
97 "--deselect=tests/test_logs/test_integration.py::test_put_subscription_filter_with_lambda"
98 "--deselect=tests/test_sqs/test_integration.py::test_invoke_function_from_sqs_exception"
99 "--deselect=tests/test_sqs/test_sqs_integration.py::test_invoke_function_from_sqs_exception"
100 "--deselect=tests/test_stepfunctions/test_stepfunctions.py::test_state_machine_creation_fails_with_invalid_names"
101 "--deselect=tests/test_stepfunctions/test_stepfunctions.py::test_state_machine_list_executions_with_pagination"
102 "--deselect=tests/test_iotdata/test_iotdata.py::test_update"
103 "--deselect=tests/test_iotdata/test_iotdata.py::test_basic"
104 "--deselect=tests/test_iotdata/test_iotdata.py::test_delete_field_from_device_shadow"
105 "--deselect=tests/test_iotdata/test_iotdata.py::test_publish"
106 "--deselect=tests/test_s3/test_server.py::test_s3_server_bucket_versioning"
107 "--deselect=tests/test_s3/test_multiple_accounts_server.py::TestAccountIdResolution::test_with_custom_request_header"
108
109 # Disable tests that require docker daemon
110 "--deselect=tests/test_events/test_events_lambdatriggers_integration.py::test_creating_bucket__invokes_lambda"
111 "--deselect=tests/test_s3/test_s3_lambda_integration.py::test_objectcreated_put__invokes_lambda"
112
113 # json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
114 "--deselect=tests/test_cloudformation/test_cloudformation_stack_integration.py::test_lambda_function"
115
116 # AssertionError: CloudWatch log event was not found.
117 "--deselect=tests/test_logs/test_integration.py::test_subscription_filter_applies_to_new_streams"
118
119 # KeyError: 'global'
120 "--deselect=tests/test_iotdata/test_server.py::test_iotdata_list"
121 "--deselect=tests/test_iotdata/test_server.py::test_publish"
122
123 # Blocks test execution
124 "--deselect=tests/test_utilities/test_threaded_server.py::TestThreadedMotoServer::test_load_data_from_inmemory_client"
125 ] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
126 "--deselect=tests/test_utilities/test_threaded_server.py::test_threaded_moto_server__different_port"
127 "--deselect=tests/test_utilities/test_threaded_server.py::TestThreadedMotoServer::test_server_can_handle_multiple_services"
128 "--deselect=tests/test_utilities/test_threaded_server.py::TestThreadedMotoServer::test_server_is_reachable"
129
130 # AssertionError: expected `{0}` to be greater than `{1}`
131 "--deselect=tests/test_databrew/test_databrew_recipes.py::test_publish_recipe"
132 ];
133
134 disabledTestPaths = [
135 # xml.parsers.expat.ExpatError: out of memory: line 1, column 0
136 "tests/test_sts/test_sts.py"
137 # botocore.exceptions.NoCredentialsError: Unable to locate credentials
138 "tests/test_redshiftdata/test_redshiftdata.py"
139 # Tries to access the network
140 "tests/test_appsync/test_appsync_schema.py"
141 "tests/test_awslambda/test_lambda_eventsourcemapping.py"
142 "tests/test_awslambda/test_lambda_invoke.py"
143 "tests/test_batch/test_batch_jobs.py"
144 "tests/test_kinesis/test_kinesis.py"
145 "tests/test_kinesis/test_kinesis_stream_consumers.py"
146 ];
147
148 disabledTests = [
149 # only appears in aarch64 currently, but best to be safe
150 "test_state_machine_list_executions_with_filter"
151 # tests fail with 404 after Werkzeug 2.2 upgrade, see https://github.com/spulec/moto/issues/5341#issuecomment-1206995825
152 "test_appsync_list_tags_for_resource"
153 "test_s3_server_post_to_bucket_redirect"
154 ];
155
156 meta = with lib; {
157 description = "Allows your tests to easily mock out AWS Services";
158 homepage = "https://github.com/spulec/moto";
159 changelog = "https://github.com/getmoto/moto/blob/${version}/CHANGELOG.md";
160 license = licenses.asl20;
161 maintainers = [ ];
162 };
163}