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