1{ lib
2, buildPythonPackage
3, certifi
4, chardet
5, fetchPypi
6, idna
7, pytest-mock
8, pytest-xdist
9, pytestCheckHook
10, urllib3
11, isPy27
12}:
13
14buildPythonPackage rec {
15 pname = "requests";
16 version = "2.25.1";
17
18 src = fetchPypi {
19 inherit pname version;
20 sha256 = "sha256-J5c91KkEpPE7JjoZyGbBO5KjntHJZGVfAl8/jT11uAQ=";
21 };
22
23 postPatch = ''
24 # Use latest idna
25 substituteInPlace setup.py --replace ",<3" ""
26 '';
27
28 propagatedBuildInputs = [
29 certifi
30 chardet
31 idna
32 urllib3
33 ];
34
35 checkInputs = [
36 pytest-mock
37 pytest-xdist
38 pytestCheckHook
39 ];
40
41 # AttributeError: 'KeywordMapping' object has no attribute 'get'
42 doCheck = !isPy27;
43
44 disabledTests = [
45 # Disable tests that require network access and use httpbin
46 "requests.api.request"
47 "requests.models.PreparedRequest"
48 "requests.sessions.Session"
49 "requests"
50 "test_redirecting_to_bad_url"
51 "test_requests_are_updated_each_time"
52 "test_should_bypass_proxies_pass_only_hostname"
53 "test_urllib3_pool_connection_closed"
54 "test_urllib3_retries"
55 "test_use_proxy_from_environment"
56 "TestRequests"
57 "TestTimeout"
58 ];
59
60 pythonImportsCheck = [ "requests" ];
61
62 meta = with lib; {
63 description = "Simple HTTP library for Python";
64 homepage = "http://docs.python-requests.org/en/latest/";
65 license = licenses.asl20;
66 maintainers = with maintainers; [ fab ];
67 };
68}