1{ lib
2, stdenv
3, buildPythonPackage
4, fetchFromGitHub
5, isPy27
6, mock
7, pyparsing
8, pytest-forked
9, pytest-randomly
10, pytest-timeout
11, pytest-xdist
12, pytestCheckHook
13, six
14}:
15
16buildPythonPackage rec {
17 pname = "httplib2";
18 version = "0.20.1";
19
20 src = fetchFromGitHub {
21 owner = pname;
22 repo = pname;
23 rev = "v${version}";
24 sha256 = "sha256-1zqs3YRVtm5DwewETLtRg5XhMJPJsMi0QLfeGirOURs=";
25 };
26
27 postPatch = ''
28 sed -i "/--cov/d" setup.cfg
29 '';
30
31 propagatedBuildInputs = [ pyparsing ];
32
33 pythonImportsCheck = [ "httplib2" ];
34
35 # Don't run tests for Python 2.7
36 doCheck = !isPy27;
37
38 checkInputs = [
39 mock
40 pytest-forked
41 pytest-randomly
42 pytest-timeout
43 pytest-xdist
44 six
45 pytestCheckHook
46 ];
47
48 disabledTests = lib.optionals (stdenv.isDarwin) [
49 # fails with HTTP 408 Request Timeout, instead of expected 200 OK
50 "test_timeout_subsequent"
51 ];
52
53 pytestFlagsArray = [ "--ignore python2" ];
54
55 meta = with lib; {
56 description = "A comprehensive HTTP client library";
57 homepage = "https://httplib2.readthedocs.io";
58 license = licenses.mit;
59 maintainers = with maintainers; [ fab ];
60 };
61}