1{
2 lib,
3 antlr4-python3-runtime,
4 aws-xray-sdk,
5 boto3,
6 botocore,
7 buildPythonPackage,
8 cfn-lint,
9 crc32c,
10 cryptography,
11 docker,
12 fetchFromGitHub,
13 flask-cors,
14 flask,
15 freezegun,
16 graphql-core,
17 jinja2,
18 joserfc,
19 jsonpath-ng,
20 jsonschema,
21 multipart,
22 openapi-spec-validator,
23 py-partiql-parser,
24 pyparsing,
25 pytest-order,
26 pytest-xdist,
27 pytestCheckHook,
28 python-dateutil,
29 pythonOlder,
30 pyyaml,
31 requests,
32 responses,
33 setuptools,
34 werkzeug,
35 xmltodict,
36}:
37
38buildPythonPackage rec {
39 pname = "moto";
40 version = "5.1.1";
41 pyproject = true;
42
43 disabled = pythonOlder "3.8";
44
45 src = fetchFromGitHub {
46 owner = "getmoto";
47 repo = "moto";
48 tag = version;
49 hash = "sha256-KMIOLM7KQqF2JwYWHWAD9GVKRTd2adVBubwWrnlHGoQ=";
50 };
51
52 build-system = [
53 setuptools
54 ];
55
56 dependencies = [
57 boto3
58 botocore
59 cryptography
60 requests
61 xmltodict
62 werkzeug
63 python-dateutil
64 responses
65 jinja2
66 ];
67
68 optional-dependencies = {
69 all = [
70 antlr4-python3-runtime
71 joserfc
72 jsonpath-ng
73 docker
74 graphql-core
75 pyyaml
76 cfn-lint
77 jsonschema
78 openapi-spec-validator
79 pyparsing
80 py-partiql-parser
81 aws-xray-sdk
82 setuptools
83 multipart
84 ];
85 proxy = [
86 antlr4-python3-runtime
87 joserfc
88 jsonpath-ng
89 docker
90 graphql-core
91 pyyaml
92 cfn-lint
93 openapi-spec-validator
94 pyparsing
95 py-partiql-parser
96 aws-xray-sdk
97 setuptools
98 multipart
99 ];
100 server = [
101 antlr4-python3-runtime
102 joserfc
103 jsonpath-ng
104 docker
105 graphql-core
106 pyyaml
107 cfn-lint
108 openapi-spec-validator
109 pyparsing
110 py-partiql-parser
111 aws-xray-sdk
112 setuptools
113 flask
114 flask-cors
115 ];
116 acm = [ ];
117 acmpca = [ ];
118 amp = [ ];
119 apigateway = [
120 pyyaml
121 joserfc
122 openapi-spec-validator
123 ];
124 apigatewayv2 = [
125 pyyaml
126 openapi-spec-validator
127 ];
128 applicationautoscaling = [ ];
129 appsync = [
130 graphql-core
131 ];
132 athena = [ ];
133 autoscaling = [ ];
134 awslambda = [
135 docker
136 ];
137 awslambda_simple = [ ];
138 backup = [ ];
139 batch = [
140 docker
141 ];
142 batch_simple = [ ];
143 budgets = [ ];
144 ce = [ ];
145 cloudformation = [
146 joserfc
147 docker
148 graphql-core
149 pyyaml
150 cfn-lint
151 openapi-spec-validator
152 pyparsing
153 py-partiql-parser
154 aws-xray-sdk
155 setuptools
156 ];
157 cloudfront = [ ];
158 cloudtrail = [ ];
159 cloudwatch = [ ];
160 codebuild = [ ];
161 codecommit = [ ];
162 codepipeline = [ ];
163 cognitoidentity = [ ];
164 cognitoidp = [
165 joserfc
166 ];
167 comprehend = [ ];
168 config = [ ];
169 databrew = [ ];
170 datapipeline = [ ];
171 datasync = [ ];
172 dax = [ ];
173 dms = [ ];
174 ds = [ ];
175 dynamodb = [
176 docker
177 py-partiql-parser
178 ];
179 dynamodbstreams = [
180 docker
181 py-partiql-parser
182 ];
183 ebs = [ ];
184 ec2 = [ ];
185 ec2instanceconnect = [ ];
186 ecr = [ ];
187 ecs = [ ];
188 efs = [ ];
189 eks = [ ];
190 elasticache = [ ];
191 elasticbeanstalk = [ ];
192 elastictranscoder = [ ];
193 elb = [ ];
194 elbv2 = [ ];
195 emr = [ ];
196 emrcontainers = [ ];
197 emrserverless = [ ];
198 es = [ ];
199 events = [
200 jsonpath-ng
201 ];
202 firehose = [ ];
203 forecast = [ ];
204 glacier = [ ];
205 glue = [
206 pyparsing
207 ];
208 greengrass = [ ];
209 guardduty = [ ];
210 iam = [ ];
211 inspector2 = [ ];
212 iot = [ ];
213 iotdata = [ ];
214 ivs = [ ];
215 kinesis = [ ];
216 kinesisvideo = [ ];
217 kinesisvideoarchivedmedia = [ ];
218 kms = [ ];
219 logs = [ ];
220 managedblockchain = [ ];
221 mediaconnect = [ ];
222 medialive = [ ];
223 mediapackage = [ ];
224 mediastore = [ ];
225 mediastoredata = [ ];
226 meteringmarketplace = [ ];
227 mq = [ ];
228 opsworks = [ ];
229 organizations = [ ];
230 panorama = [ ];
231 personalize = [ ];
232 pinpoint = [ ];
233 polly = [ ];
234 quicksight = [
235 jsonschema
236 ];
237 ram = [ ];
238 rds = [ ];
239 redshift = [ ];
240 redshiftdata = [ ];
241 rekognition = [ ];
242 resourcegroups = [ ];
243 resourcegroupstaggingapi = [
244 joserfc
245 docker
246 graphql-core
247 pyyaml
248 cfn-lint
249 openapi-spec-validator
250 pyparsing
251 py-partiql-parser
252 ];
253 route53 = [ ];
254 route53resolver = [ ];
255 s3 = [
256 pyyaml
257 py-partiql-parser
258 ];
259 s3crc32c = [
260 pyyaml
261 py-partiql-parser
262 crc32c
263 ];
264 s3control = [ ];
265 sagemaker = [ ];
266 sdb = [ ];
267 scheduler = [ ];
268 secretsmanager = [ ];
269 servicediscovery = [ ];
270 servicequotas = [ ];
271 ses = [ ];
272 signer = [ ];
273 sns = [ ];
274 sqs = [ ];
275 ssm = [
276 pyyaml
277 ];
278 ssoadmin = [ ];
279 stepfunctions = [
280 antlr4-python3-runtime
281 jsonpath-ng
282 ];
283 sts = [ ];
284 support = [ ];
285 swf = [ ];
286 textract = [ ];
287 timestreamwrite = [ ];
288 transcribe = [ ];
289 wafv2 = [ ];
290 xray = [
291 aws-xray-sdk
292 setuptools
293 ];
294 };
295
296 __darwinAllowLocalNetworking = true;
297
298 nativeCheckInputs = [
299 freezegun
300 pytest-order
301 pytest-xdist
302 pytestCheckHook
303 ] ++ optional-dependencies.server;
304
305 # Some tests depend on AWS credentials environment variables to be set.
306 env.AWS_ACCESS_KEY_ID = "ak";
307 env.AWS_SECRET_ACCESS_KEY = "sk";
308
309 pytestFlagsArray = [
310 "-m"
311 "'not network and not requires_docker'"
312
313 # Matches upstream configuration, presumably due to expensive setup/teardown.
314 "--dist"
315 "loadscope"
316 ];
317
318 disabledTests = [
319 # Fails at local name resolution
320 "test_with_custom_request_header"
321 "test_s3_server_post_cors_multiple_origins"
322 "test_create_multipart"
323 "test_aws_and_http_requests"
324 "test_http_requests"
325
326 # Fails at resolving google.com
327 "test_put_record_http_destination"
328 "test_put_record_batch_http_destination"
329
330 # Fails at resolving s3.amazonaws.com
331 "test_passthrough_calls_for_wildcard_urls"
332 "test_passthrough_calls_for_specific_url"
333 "test_passthrough_calls_for_entire_service"
334
335 # Download recordings returns faulty JSON
336 "test_ec2_instance_creation_recording_on"
337 "test_ec2_instance_creation__recording_off"
338
339 # Connection Reset by Peer, when connecting to localhost:5678
340 "test_replay"
341
342 # Flaky under parallel execution
343 "test_cloudformation_server_get"
344 "test_should_find_bucket"
345
346 # AssertionError: assert ResourceWarning not in [<class 'ResourceWarning'>, <class 'ResourceWarning'>]
347 "test_delete_object_with_version"
348
349 # KeyError because of ap-southeast-5-apse5-az
350 "test_zoneId_in_availability_zones"
351
352 # Parameter validation fails
353 "test_conditional_write"
354
355 # Requires newer botocore version
356 "test_dynamodb_with_account_id_routing"
357
358 # Assumes too much about threading.Timer() behavior (that it honors the
359 # timeout precisely and that the thread handler will complete in just 0.1s
360 # from the requested timeout)
361 "test_start_and_fire_timer_decision"
362 ];
363
364 disabledTestPaths = [
365 # Flaky under parallel execution, Connection Reset errors to localhost.
366 "tests/test_moto_api/recorder/test_recorder.py"
367
368 # Flaky under parallel execution
369 "tests/test_resourcegroupstaggingapi/*.py"
370
371 # Tries to access the network
372 "tests/test_batch/test_batch_jobs.py"
373
374 # Threading tests regularly blocks test execution
375 "tests/test_utilities/test_threaded_server.py"
376 "tests/test_s3/test_s3_bucket_policy.py"
377
378 # https://github.com/getmoto/moto/issues/7786
379 "tests/test_dynamodb/test_dynamodb_import_table.py"
380
381 # Infinite recursion with pycognito
382 "tests/test_cognitoidp/test_cognitoidp.py"
383 ];
384
385 meta = {
386 description = "Allows your tests to easily mock out AWS Services";
387 homepage = "https://github.com/getmoto/moto";
388 changelog = "https://github.com/getmoto/moto/blob/${version}/CHANGELOG.md";
389 license = lib.licenses.asl20;
390 maintainers = with lib.maintainers; [ onny ];
391 };
392}