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

92 lines
1.9 KiB
Nix
Raw Normal View History

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