nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, buildPythonPackage, fetchPypi, isPy27, fetchpatch
2, aws-xray-sdk
3, backports_tempfile
4, boto
5, boto3
6, botocore
7, cfn-lint
8, docker
9, flask
10, freezegun
11, jinja2
12, jsondiff
13, mock
14, nose
15, pyaml
16, python-jose
17, pytz
18, requests
19, responses
20, six
21, sshpubkeys
22, sure
23, werkzeug
24, xmltodict
25, parameterized
26}:
27
28buildPythonPackage rec {
29 pname = "moto";
30 version = "1.3.14";
31
32 src = fetchPypi {
33 inherit pname version;
34 sha256 = "0fm09074qic24h8rw9a0paklygyb7xd0ch4890y4v8lj2pnsxbkr";
35 };
36
37 postPatch = ''
38 substituteInPlace setup.py \
39 --replace "jsondiff==1.1.2" "jsondiff~=1.1"
40 sed -i '/datetime/d' setup.py # should be taken care of by std library
41 '';
42
43 propagatedBuildInputs = [
44 aws-xray-sdk
45 boto
46 boto3
47 botocore
48 cfn-lint
49 docker
50 flask # required for server
51 jinja2
52 jsondiff
53 mock
54 pyaml
55 python-jose
56 pytz
57 six
58 requests
59 responses
60 sshpubkeys
61 werkzeug
62 xmltodict
63 ] ++ lib.optionals isPy27 [ backports_tempfile ];
64
65 checkInputs = [ boto3 freezegun nose sure parameterized ];
66
67 checkPhase = ''
68 nosetests -v ./tests/ \
69 -e test_invoke_function_from_sns \
70 -e test_invoke_requestresponse_function \
71 -e test_context_manager \
72 -e test_decorator_start_and_stop \
73 -e test_invoke_event_function \
74 -e test_invoke_function_from_dynamodb \
75 -e test_invoke_function_from_sqs \
76 -e test_invoke_lambda_error \
77 -e test_invoke_async_function \
78 -e test_passthrough_requests
79 '';
80
81 # Disabling because of 20 failing tests due to https://github.com/spulec/moto/issues/2728
82 # We should enable these as soon as possible again though. Note the issue
83 # is unrelated to the docutils 0.16 bump.
84 doCheck = false;
85
86 meta = with lib; {
87 description = "Allows your tests to easily mock out AWS Services";
88 homepage = https://github.com/spulec/moto;
89 license = licenses.asl20;
90 maintainers = [ ];
91 };
92}