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}:
26
27buildPythonPackage rec {
28 pname = "moto";
29 version = "1.3.13";
30
31 src = fetchPypi {
32 inherit pname version;
33 sha256 = "0rhbjvqi1khp80gfnl3x632kwlpq3k7m8f13nidznixdpa78vm4m";
34 };
35
36 # Backported fix from 1.3.14.dev for compatibility with botocore >= 1.9.198.
37 patches = [
38 (fetchpatch {
39 url = "https://github.com/spulec/moto/commit/e4a4e6183560489e98b95e815b439c7a1cf3566c.diff";
40 sha256 = "1fixr7riimnldiikv33z4jwjgcsccps0c6iif40x8wmpvgcfs0cb";
41 })
42 ];
43
44 postPatch = ''
45 substituteInPlace setup.py \
46 --replace "jsondiff==1.1.2" "jsondiff~=1.1"
47 sed -i '/datetime/d' setup.py # should be taken care of by std library
48 '';
49
50 propagatedBuildInputs = [
51 aws-xray-sdk
52 boto
53 boto3
54 botocore
55 cfn-lint
56 docker
57 flask # required for server
58 jinja2
59 jsondiff
60 mock
61 pyaml
62 python-jose
63 pytz
64 six
65 requests
66 responses
67 sshpubkeys
68 werkzeug
69 xmltodict
70 ] ++ lib.optionals isPy27 [ backports_tempfile ];
71
72 checkInputs = [ boto3 freezegun nose sure ];
73
74 checkPhase = ''nosetests -v ./tests/ \
75 -e test_invoke_function_from_sns \
76 -e test_invoke_requestresponse_function \
77 -e test_context_manager \
78 -e test_decorator_start_and_stop'';
79
80 meta = with lib; {
81 description = "Allows your tests to easily mock out AWS Services";
82 homepage = https://github.com/spulec/moto;
83 license = licenses.asl20;
84 maintainers = [ ];
85 };
86}