18 buildPythonPackage rec {
21 disabled = pythonOlder "3.7";
23 __darwinAllowLocalNetworking = true;
26 inherit pname version;
27 hash = "sha256-fFWZsQL+3apmHIJsVqtP7ii/0X9avKHrvj5/GdfJeYM=";
31 # Use the default NixOS CA bundle from the certifi package
32 ./0001-Prefer-NixOS-Nix-default-CA-bundles-over-certifi.patch
35 propagatedBuildInputs = [
43 passthru.optional-dependencies = {
48 use_chardet_on_py3 = [
58 ++ passthru.optional-dependencies.socks;
61 # Disable tests that require network access and use httpbin
62 "requests.api.request"
63 "requests.models.PreparedRequest"
64 "requests.sessions.Session"
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"
74 ] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
75 # Fatal Python error: Aborted
80 disabledTestPaths = lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
81 # Fatal Python error: Aborted
82 "tests/test_lowlevel.py"
85 pythonImportsCheck = [
90 description = "HTTP library for Python";
91 homepage = "http://docs.python-requests.org/";
92 license = licenses.asl20;
93 maintainers = with maintainers; [ fab ];