summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/moto/default.nix
blob: 406037dfcfc844cd5fc9c7f5c7e17a441d154012 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
{
  lib,
  antlr4-python3-runtime,
  aws-xray-sdk,
  boto3,
  botocore,
  buildPythonPackage,
  cfn-lint,
  crc32c,
  cryptography,
  docker,
  fetchFromGitHub,
  flask-cors,
  flask,
  freezegun,
  graphql-core,
  jinja2,
  joserfc,
  jsonpath-ng,
  jsonschema,
  multipart,
  openapi-spec-validator,
  py-partiql-parser,
  pyparsing,
  pytest-order,
  pytest-xdist,
  pytestCheckHook,
  python-dateutil,
  pyyaml,
  requests,
  responses,
  setuptools,
  werkzeug,
  xmltodict,
}:

buildPythonPackage rec {
  pname = "moto";
  version = "5.1.11";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "getmoto";
    repo = "moto";
    tag = version;
    hash = "sha256-krZrPzH8/pOGvQTcofT2TzyytDXs9FTpqh9JK0QN44E=";
  };

  build-system = [
    setuptools
  ];

  dependencies = [
    boto3
    botocore
    cryptography
    requests
    xmltodict
    werkzeug
    python-dateutil
    responses
    jinja2
  ];

  optional-dependencies = {
    all = [
      antlr4-python3-runtime
      joserfc
      jsonpath-ng
      docker
      graphql-core
      pyyaml
      cfn-lint
      jsonschema
      openapi-spec-validator
      pyparsing
      py-partiql-parser
      aws-xray-sdk
      setuptools
      multipart
    ];
    proxy = [
      antlr4-python3-runtime
      joserfc
      jsonpath-ng
      docker
      graphql-core
      pyyaml
      cfn-lint
      openapi-spec-validator
      pyparsing
      py-partiql-parser
      aws-xray-sdk
      setuptools
      multipart
    ];
    server = [
      antlr4-python3-runtime
      joserfc
      jsonpath-ng
      docker
      graphql-core
      pyyaml
      cfn-lint
      openapi-spec-validator
      pyparsing
      py-partiql-parser
      aws-xray-sdk
      setuptools
      flask
      flask-cors
    ];
    acm = [ ];
    acmpca = [ ];
    amp = [ ];
    apigateway = [
      pyyaml
      joserfc
      openapi-spec-validator
    ];
    apigatewayv2 = [
      pyyaml
      openapi-spec-validator
    ];
    applicationautoscaling = [ ];
    appsync = [
      graphql-core
    ];
    athena = [ ];
    autoscaling = [ ];
    awslambda = [
      docker
    ];
    awslambda_simple = [ ];
    backup = [ ];
    batch = [
      docker
    ];
    batch_simple = [ ];
    budgets = [ ];
    ce = [ ];
    cloudformation = [
      joserfc
      docker
      graphql-core
      pyyaml
      cfn-lint
      openapi-spec-validator
      pyparsing
      py-partiql-parser
      aws-xray-sdk
      setuptools
    ];
    cloudfront = [ ];
    cloudtrail = [ ];
    cloudwatch = [ ];
    codebuild = [ ];
    codecommit = [ ];
    codepipeline = [ ];
    cognitoidentity = [ ];
    cognitoidp = [
      joserfc
    ];
    comprehend = [ ];
    config = [ ];
    databrew = [ ];
    datapipeline = [ ];
    datasync = [ ];
    dax = [ ];
    dms = [ ];
    ds = [ ];
    dynamodb = [
      docker
      py-partiql-parser
    ];
    dynamodbstreams = [
      docker
      py-partiql-parser
    ];
    ebs = [ ];
    ec2 = [ ];
    ec2instanceconnect = [ ];
    ecr = [ ];
    ecs = [ ];
    efs = [ ];
    eks = [ ];
    elasticache = [ ];
    elasticbeanstalk = [ ];
    elastictranscoder = [ ];
    elb = [ ];
    elbv2 = [ ];
    emr = [ ];
    emrcontainers = [ ];
    emrserverless = [ ];
    es = [ ];
    events = [
      jsonpath-ng
    ];
    firehose = [ ];
    forecast = [ ];
    glacier = [ ];
    glue = [
      pyparsing
    ];
    greengrass = [ ];
    guardduty = [ ];
    iam = [ ];
    inspector2 = [ ];
    iot = [ ];
    iotdata = [ ];
    ivs = [ ];
    kinesis = [ ];
    kinesisvideo = [ ];
    kinesisvideoarchivedmedia = [ ];
    kms = [ ];
    logs = [ ];
    managedblockchain = [ ];
    mediaconnect = [ ];
    medialive = [ ];
    mediapackage = [ ];
    mediastore = [ ];
    mediastoredata = [ ];
    meteringmarketplace = [ ];
    mq = [ ];
    opsworks = [ ];
    organizations = [ ];
    panorama = [ ];
    personalize = [ ];
    pinpoint = [ ];
    polly = [ ];
    quicksight = [
      jsonschema
    ];
    ram = [ ];
    rds = [ ];
    redshift = [ ];
    redshiftdata = [ ];
    rekognition = [ ];
    resourcegroups = [ ];
    resourcegroupstaggingapi = [
      joserfc
      docker
      graphql-core
      pyyaml
      cfn-lint
      openapi-spec-validator
      pyparsing
      py-partiql-parser
    ];
    route53 = [ ];
    route53resolver = [ ];
    s3 = [
      pyyaml
      py-partiql-parser
    ];
    s3crc32c = [
      pyyaml
      py-partiql-parser
      crc32c
    ];
    s3control = [ ];
    sagemaker = [ ];
    sdb = [ ];
    scheduler = [ ];
    secretsmanager = [ ];
    servicediscovery = [ ];
    servicequotas = [ ];
    ses = [ ];
    signer = [ ];
    sns = [ ];
    sqs = [ ];
    ssm = [
      pyyaml
    ];
    ssoadmin = [ ];
    stepfunctions = [
      antlr4-python3-runtime
      jsonpath-ng
    ];
    sts = [ ];
    support = [ ];
    swf = [ ];
    textract = [ ];
    timestreamwrite = [ ];
    transcribe = [ ];
    wafv2 = [ ];
    xray = [
      aws-xray-sdk
      setuptools
    ];
  };

  __darwinAllowLocalNetworking = true;

  nativeCheckInputs = [
    freezegun
    pytest-order
    pytest-xdist
    pytestCheckHook
  ]
  ++ optional-dependencies.server;

  # Some tests depend on AWS credentials environment variables to be set.
  env.AWS_ACCESS_KEY_ID = "ak";
  env.AWS_SECRET_ACCESS_KEY = "sk";

  pytestFlags = [
    # Matches upstream configuration, presumably due to expensive setup/teardown.
    "--dist=loadscope"
  ];

  disabledTestMarks = [
    "network"
    "requires_docker"
  ];

  disabledTests = [
    # Fails at local name resolution
    "test_with_custom_request_header"
    "test_s3_server_post_cors_multiple_origins"
    "test_create_multipart"
    "test_aws_and_http_requests"
    "test_http_requests"

    # Fails at resolving google.com
    "test_put_record_http_destination"
    "test_put_record_batch_http_destination"

    # Fails at resolving s3.amazonaws.com
    "test_passthrough_calls_for_wildcard_urls"
    "test_passthrough_calls_for_specific_url"
    "test_passthrough_calls_for_entire_service"

    # Download recordings returns faulty JSON
    "test_ec2_instance_creation_recording_on"
    "test_ec2_instance_creation__recording_off"

    # Connection Reset by Peer, when connecting to localhost:5678
    "test_replay"

    # Flaky under parallel execution
    "test_cloudformation_server_get"
    "test_should_find_bucket"

    # AssertionError: assert ResourceWarning not in [<class 'ResourceWarning'>, <class 'ResourceWarning'>]
    "test_delete_object_with_version"

    # KeyError because of ap-southeast-5-apse5-az
    "test_zoneId_in_availability_zones"

    # Parameter validation fails
    "test_conditional_write"

    # Assumes too much about threading.Timer() behavior (that it honors the
    # timeout precisely and that the thread handler will complete in just 0.1s
    # from the requested timeout)
    "test_start_and_fire_timer_decision"
  ];

  disabledTestPaths = [
    # Flaky under parallel execution, Connection Reset errors to localhost.
    "tests/test_moto_api/recorder/test_recorder.py"

    # Flaky under parallel execution
    "tests/test_resourcegroupstaggingapi/*.py"

    # Tries to access the network
    "tests/test_batch/test_batch_jobs.py"

    # Threading tests regularly blocks test execution
    "tests/test_utilities/test_threaded_server.py"
    "tests/test_s3/test_s3_bucket_policy.py"

    # https://github.com/getmoto/moto/issues/7786
    "tests/test_dynamodb/test_dynamodb_import_table.py"

    # Infinite recursion with pycognito
    "tests/test_cognitoidp/test_cognitoidp.py"

    # botocore.exceptions.ParamValidationError: Parameter validation failed: Unknown parameter in input: "EnableWorkDocs", must be one of: [...]
    "tests/test_workspaces/test_workspaces.py"

    # Requires sagemaker client
    "other_langs/tests_sagemaker_client/test_model_training.py"
  ];

  meta = {
    description = "Allows your tests to easily mock out AWS Services";
    homepage = "https://github.com/getmoto/moto";
    changelog = "https://github.com/getmoto/moto/blob/${version}/CHANGELOG.md";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ onny ];
  };
}