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.9";
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-UbCSGpvS8Jvpe8iV1rVplSoGykHSup9pVTd3odbPq6Y=";
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 ]
304 ++ optional-dependencies.server;
305
306 # Some tests depend on AWS credentials environment variables to be set.
307 env.AWS_ACCESS_KEY_ID = "ak";
308 env.AWS_SECRET_ACCESS_KEY = "sk";
309
310 pytestFlags = [
311 # Matches upstream configuration, presumably due to expensive setup/teardown.
312 "--dist=loadscope"
313 ];
314
315 disabledTestMarks = [
316 "network"
317 "requires_docker"
318 ];
319
320 disabledTests = [
321 # Fails at local name resolution
322 "test_with_custom_request_header"
323 "test_s3_server_post_cors_multiple_origins"
324 "test_create_multipart"
325 "test_aws_and_http_requests"
326 "test_http_requests"
327
328 # Fails at resolving google.com
329 "test_put_record_http_destination"
330 "test_put_record_batch_http_destination"
331
332 # Fails at resolving s3.amazonaws.com
333 "test_passthrough_calls_for_wildcard_urls"
334 "test_passthrough_calls_for_specific_url"
335 "test_passthrough_calls_for_entire_service"
336
337 # Download recordings returns faulty JSON
338 "test_ec2_instance_creation_recording_on"
339 "test_ec2_instance_creation__recording_off"
340
341 # Connection Reset by Peer, when connecting to localhost:5678
342 "test_replay"
343
344 # Flaky under parallel execution
345 "test_cloudformation_server_get"
346 "test_should_find_bucket"
347
348 # AssertionError: assert ResourceWarning not in [<class 'ResourceWarning'>, <class 'ResourceWarning'>]
349 "test_delete_object_with_version"
350
351 # KeyError because of ap-southeast-5-apse5-az
352 "test_zoneId_in_availability_zones"
353
354 # Parameter validation fails
355 "test_conditional_write"
356
357 # Assumes too much about threading.Timer() behavior (that it honors the
358 # timeout precisely and that the thread handler will complete in just 0.1s
359 # from the requested timeout)
360 "test_start_and_fire_timer_decision"
361 ];
362
363 disabledTestPaths = [
364 # Flaky under parallel execution, Connection Reset errors to localhost.
365 "tests/test_moto_api/recorder/test_recorder.py"
366
367 # Flaky under parallel execution
368 "tests/test_resourcegroupstaggingapi/*.py"
369
370 # Tries to access the network
371 "tests/test_batch/test_batch_jobs.py"
372
373 # Threading tests regularly blocks test execution
374 "tests/test_utilities/test_threaded_server.py"
375 "tests/test_s3/test_s3_bucket_policy.py"
376
377 # https://github.com/getmoto/moto/issues/7786
378 "tests/test_dynamodb/test_dynamodb_import_table.py"
379
380 # Infinite recursion with pycognito
381 "tests/test_cognitoidp/test_cognitoidp.py"
382
383 # botocore.exceptions.ParamValidationError: Parameter validation failed: Unknown parameter in input: "EnableWorkDocs", must be one of: [...]
384 "tests/test_workspaces/test_workspaces.py"
385
386 # Requires sagemaker client
387 "other_langs/tests_sagemaker_client/test_model_training.py"
388 ];
389
390 meta = {
391 description = "Allows your tests to easily mock out AWS Services";
392 homepage = "https://github.com/getmoto/moto";
393 changelog = "https://github.com/getmoto/moto/blob/${version}/CHANGELOG.md";
394 license = lib.licenses.asl20;
395 maintainers = with lib.maintainers; [ onny ];
396 };
397}