ansible-later: 2.0.22 -> 2.0.23
[NixPkgs.git] / pkgs / development / python-modules / requests / default.nix
blob5eab25fa3e15dfb8c6504f95f97de27dd46fddc8
1 { lib
2 , stdenv
3 , brotlicffi
4 , buildPythonPackage
5 , certifi
6 , chardet
7 , charset-normalizer
8 , fetchPypi
9 , idna
10 , pysocks
11 , pytest-mock
12 , pytest-xdist
13 , pytestCheckHook
14 , pythonOlder
15 , urllib3
18 buildPythonPackage rec {
19   pname = "requests";
20   version = "2.28.1";
21   disabled = pythonOlder "3.7";
23   __darwinAllowLocalNetworking = true;
25   src = fetchPypi {
26     inherit pname version;
27     hash = "sha256-fFWZsQL+3apmHIJsVqtP7ii/0X9avKHrvj5/GdfJeYM=";
28   };
30   patches = [
31     # Use the default NixOS CA bundle from the certifi package
32     ./0001-Prefer-NixOS-Nix-default-CA-bundles-over-certifi.patch
33   ];
35   propagatedBuildInputs = [
36     brotlicffi
37     certifi
38     charset-normalizer
39     idna
40     urllib3
41   ];
43   passthru.optional-dependencies = {
44     security = [];
45     socks = [
46       pysocks
47     ];
48     use_chardet_on_py3 = [
49       chardet
50     ];
51   };
53   checkInputs = [
54     pytest-mock
55     pytest-xdist
56     pytestCheckHook
57   ]
58   ++ passthru.optional-dependencies.socks;
60   disabledTests = [
61     # Disable tests that require network access and use httpbin
62     "requests.api.request"
63     "requests.models.PreparedRequest"
64     "requests.sessions.Session"
65     "requests"
66     "test_redirecting_to_bad_url"
67     "test_requests_are_updated_each_time"
68     "test_should_bypass_proxies_pass_only_hostname"
69     "test_urllib3_pool_connection_closed"
70     "test_urllib3_retries"
71     "test_use_proxy_from_environment"
72     "TestRequests"
73     "TestTimeout"
74   ] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
75     # Fatal Python error: Aborted
76     "test_basic_response"
77     "test_text_response"
78   ];
80   disabledTestPaths = lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
81     # Fatal Python error: Aborted
82     "tests/test_lowlevel.py"
83   ];
85   pythonImportsCheck = [
86     "requests"
87   ];
89   meta = with lib; {
90     description = "HTTP library for Python";
91     homepage = "http://docs.python-requests.org/";
92     license = licenses.asl20;
93     maintainers = with maintainers; [ fab ];
94   };