1{ buildPythonPackage
2, lib
3, isPy27
4, six
5, fetchPypi
6, pyyaml
7, mock
8, contextlib2
9, wrapt
10, pytest
11, pytest-httpbin
12, yarl
13, pythonOlder
14, pythonAtLeast
15}:
16
17buildPythonPackage rec {
18 pname = "vcrpy";
19 version = "4.2.1";
20
21 disabled = isPy27;
22
23 src = fetchPypi {
24 inherit pname version;
25 sha256 = "sha256-fNPoGixJLgHCgfGAvMKoa1ILFz0rZWy12J2ZR1Qj4BM=";
26 };
27
28 checkInputs = [
29 pytest
30 pytest-httpbin
31 ];
32
33 propagatedBuildInputs = [
34 pyyaml
35 wrapt
36 six
37 ]
38 ++ lib.optionals (pythonOlder "3.3") [ contextlib2 mock ]
39 ++ lib.optionals (pythonAtLeast "3.4") [ yarl ];
40
41 checkPhase = ''
42 py.test --ignore=tests/integration -k "not TestVCRConnection"
43 '';
44
45 meta = with lib; {
46 description = "Automatically mock your HTTP interactions to simplify and speed up testing";
47 homepage = "https://github.com/kevin1024/vcrpy";
48 license = licenses.mit;
49 };
50}
51