2019-08-15 12:18:16 +02:00
|
|
|
{ lib, buildPythonPackage, fetchPypi, isPy27, fetchpatch
|
2019-07-24 01:00:32 +02:00
|
|
|
, aws-xray-sdk
|
|
|
|
, backports_tempfile
|
|
|
|
, boto
|
|
|
|
, boto3
|
|
|
|
, botocore
|
|
|
|
, cfn-lint
|
|
|
|
, docker
|
|
|
|
, flask
|
|
|
|
, freezegun
|
|
|
|
, jinja2
|
|
|
|
, jsondiff
|
|
|
|
, mock
|
|
|
|
, nose
|
|
|
|
, pyaml
|
|
|
|
, python-jose
|
|
|
|
, pytz
|
|
|
|
, requests
|
|
|
|
, responses
|
|
|
|
, six
|
|
|
|
, sshpubkeys
|
|
|
|
, sure
|
|
|
|
, werkzeug
|
|
|
|
, xmltodict
|
2019-10-27 17:23:41 +01:00
|
|
|
, isPy38
|
2019-07-24 01:00:32 +02:00
|
|
|
}:
|
2017-09-15 15:15:54 +02:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "moto";
|
2019-08-15 12:18:16 +02:00
|
|
|
version = "1.3.13";
|
2017-12-30 12:24:45 +01:00
|
|
|
|
2017-09-15 15:15:54 +02:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2019-08-15 12:18:16 +02:00
|
|
|
sha256 = "0rhbjvqi1khp80gfnl3x632kwlpq3k7m8f13nidznixdpa78vm4m";
|
2017-09-15 15:15:54 +02:00
|
|
|
};
|
|
|
|
|
2019-10-27 17:23:41 +01:00
|
|
|
# 3.8 is not yet support
|
|
|
|
# https://github.com/spulec/moto/pull/2519
|
|
|
|
disabled = isPy38;
|
|
|
|
|
2019-08-15 12:18:16 +02:00
|
|
|
# Backported fix from 1.3.14.dev for compatibility with botocore >= 1.9.198.
|
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/spulec/moto/commit/e4a4e6183560489e98b95e815b439c7a1cf3566c.diff";
|
|
|
|
sha256 = "1fixr7riimnldiikv33z4jwjgcsccps0c6iif40x8wmpvgcfs0cb";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2018-04-07 12:25:04 +02:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
2019-07-24 01:00:32 +02:00
|
|
|
--replace "jsondiff==1.1.2" "jsondiff~=1.1"
|
|
|
|
sed -i '/datetime/d' setup.py # should be taken care of by std library
|
2018-04-07 12:25:04 +02:00
|
|
|
'';
|
|
|
|
|
2017-09-15 15:15:54 +02:00
|
|
|
propagatedBuildInputs = [
|
2017-12-30 12:24:45 +01:00
|
|
|
aws-xray-sdk
|
2017-09-15 15:15:54 +02:00
|
|
|
boto
|
2017-12-30 12:24:45 +01:00
|
|
|
boto3
|
2019-07-24 01:00:32 +02:00
|
|
|
botocore
|
2019-05-01 10:59:56 +02:00
|
|
|
cfn-lint
|
2019-07-24 01:00:32 +02:00
|
|
|
docker
|
|
|
|
flask # required for server
|
2017-09-15 15:15:54 +02:00
|
|
|
jinja2
|
2019-07-24 01:00:32 +02:00
|
|
|
jsondiff
|
2017-12-30 12:24:45 +01:00
|
|
|
mock
|
|
|
|
pyaml
|
2018-08-30 19:09:45 +02:00
|
|
|
python-jose
|
2019-07-24 01:00:32 +02:00
|
|
|
pytz
|
|
|
|
six
|
|
|
|
requests
|
|
|
|
responses
|
|
|
|
sshpubkeys
|
|
|
|
werkzeug
|
|
|
|
xmltodict
|
|
|
|
] ++ lib.optionals isPy27 [ backports_tempfile ];
|
2017-09-15 15:15:54 +02:00
|
|
|
|
2019-07-24 01:00:32 +02:00
|
|
|
checkInputs = [ boto3 freezegun nose sure ];
|
2017-09-15 15:15:54 +02:00
|
|
|
|
2019-07-24 01:00:32 +02:00
|
|
|
checkPhase = ''nosetests -v ./tests/ \
|
|
|
|
-e test_invoke_function_from_sns \
|
|
|
|
-e test_invoke_requestresponse_function \
|
|
|
|
-e test_context_manager \
|
|
|
|
-e test_decorator_start_and_stop'';
|
2017-09-15 15:15:54 +02:00
|
|
|
|
2019-07-24 01:00:32 +02:00
|
|
|
meta = with lib; {
|
2019-07-25 10:47:10 +02:00
|
|
|
description = "Allows your tests to easily mock out AWS Services";
|
2019-07-24 01:00:32 +02:00
|
|
|
homepage = https://github.com/spulec/moto;
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = [ ];
|
|
|
|
};
|
2017-09-15 15:15:54 +02:00
|
|
|
}
|