nixpkgs/pkgs/development/python-modules/moto/default.nix

87 lines
1.8 KiB
Nix
Raw Normal View History

2019-08-15 13:18:16 +03:00
{ lib, buildPythonPackage, fetchPypi, isPy27, fetchpatch
2019-07-24 02:00:32 +03: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
}:
2017-09-15 16:15:54 +03:00
buildPythonPackage rec {
pname = "moto";
2019-08-15 13:18:16 +03:00
version = "1.3.13";
2017-12-30 14:24:45 +03:00
2017-09-15 16:15:54 +03:00
src = fetchPypi {
inherit pname version;
2019-08-15 13:18:16 +03:00
sha256 = "0rhbjvqi1khp80gfnl3x632kwlpq3k7m8f13nidznixdpa78vm4m";
2017-09-15 16:15:54 +03:00
};
2019-08-15 13:18:16 +03: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 13:25:04 +03:00
postPatch = ''
substituteInPlace setup.py \
2019-07-24 02:00:32 +03: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 13:25:04 +03:00
'';
2017-09-15 16:15:54 +03:00
propagatedBuildInputs = [
2017-12-30 14:24:45 +03:00
aws-xray-sdk
2017-09-15 16:15:54 +03:00
boto
2017-12-30 14:24:45 +03:00
boto3
2019-07-24 02:00:32 +03:00
botocore
2019-05-01 11:59:56 +03:00
cfn-lint
2019-07-24 02:00:32 +03:00
docker
flask # required for server
2017-09-15 16:15:54 +03:00
jinja2
2019-07-24 02:00:32 +03:00
jsondiff
2017-12-30 14:24:45 +03:00
mock
pyaml
2018-08-30 20:09:45 +03:00
python-jose
2019-07-24 02:00:32 +03:00
pytz
six
requests
responses
sshpubkeys
werkzeug
xmltodict
] ++ lib.optionals isPy27 [ backports_tempfile ];
2017-09-15 16:15:54 +03:00
2019-07-24 02:00:32 +03:00
checkInputs = [ boto3 freezegun nose sure ];
2017-09-15 16:15:54 +03:00
2019-07-24 02:00:32 +03: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 16:15:54 +03:00
2019-07-24 02:00:32 +03:00
meta = with lib; {
2019-07-25 11:47:10 +03:00
description = "Allows your tests to easily mock out AWS Services";
2019-07-24 02:00:32 +03:00
homepage = https://github.com/spulec/moto;
license = licenses.asl20;
maintainers = [ ];
};
2017-09-15 16:15:54 +03:00
}