2017-04-27 08:29:59 +02:00
|
|
|
{ buildPythonPackage
|
|
|
|
, lib
|
2017-05-01 09:11:52 +02:00
|
|
|
, six
|
|
|
|
, fetchPypi
|
2017-04-27 08:29:59 +02:00
|
|
|
, pyyaml
|
|
|
|
, mock
|
|
|
|
, contextlib2
|
|
|
|
, wrapt
|
2017-05-01 09:11:52 +02:00
|
|
|
, pytest
|
2017-04-27 08:29:59 +02:00
|
|
|
, httpbin
|
|
|
|
, pytest-httpbin
|
|
|
|
, yarl
|
2017-05-01 09:11:52 +02:00
|
|
|
, pythonOlder
|
|
|
|
, pythonAtLeast
|
2017-04-27 08:29:59 +02:00
|
|
|
}:
|
2017-04-25 12:41:28 +02:00
|
|
|
|
2017-04-27 08:29:59 +02:00
|
|
|
buildPythonPackage rec {
|
2017-05-01 09:11:52 +02:00
|
|
|
pname = "vcrpy";
|
2017-06-01 18:13:24 +02:00
|
|
|
version = "1.11.1";
|
2017-05-01 09:11:52 +02:00
|
|
|
name = "${pname}-${version}";
|
2017-04-25 12:41:28 +02:00
|
|
|
|
2017-05-01 09:11:52 +02:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2017-06-01 18:13:24 +02:00
|
|
|
sha256 = "f434fe7e05d940d576ac850709ae57a738ba40e7f317076ea8d359ced5b32320";
|
2017-04-25 12:41:28 +02:00
|
|
|
};
|
|
|
|
|
2017-05-01 09:11:52 +02:00
|
|
|
checkInputs = [
|
|
|
|
pytest
|
2017-04-25 12:41:28 +02:00
|
|
|
pytest-httpbin
|
|
|
|
];
|
|
|
|
|
2017-05-01 09:11:52 +02:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
pyyaml
|
|
|
|
wrapt
|
|
|
|
six
|
|
|
|
]
|
|
|
|
++ lib.optionals (pythonOlder "3.3") [ contextlib2 mock ]
|
|
|
|
++ lib.optionals (pythonAtLeast "3.4") [ yarl ];
|
|
|
|
|
2017-04-27 08:29:59 +02:00
|
|
|
checkPhase = ''
|
2017-05-01 09:11:52 +02:00
|
|
|
py.test --ignore=tests/integration -k "not TestVCRConnection"
|
2017-04-27 08:29:59 +02:00
|
|
|
'';
|
|
|
|
|
2017-04-25 12:41:28 +02:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Automatically mock your HTTP interactions to simplify and speed up testing";
|
|
|
|
homepage = https://github.com/kevin1024/vcrpy;
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|