2021-03-09 03:18:52 +00:00
|
|
|
{ lib
|
2022-04-27 09:35:20 +00:00
|
|
|
, stdenv
|
2021-09-18 10:52:07 +00:00
|
|
|
, brotlicffi
|
2021-03-09 03:18:52 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, certifi
|
|
|
|
, chardet
|
2021-09-18 10:52:07 +00:00
|
|
|
, charset-normalizer
|
2021-03-09 03:18:52 +00:00
|
|
|
, fetchPypi
|
2023-01-20 10:41:00 +00:00
|
|
|
, fetchpatch
|
2021-03-09 03:18:52 +00:00
|
|
|
, idna
|
2022-02-10 20:34:41 +00:00
|
|
|
, pysocks
|
2021-03-09 03:18:52 +00:00
|
|
|
, pytest-mock
|
|
|
|
, pytest-xdist
|
|
|
|
, pytestCheckHook
|
2022-07-14 12:49:19 +00:00
|
|
|
, pythonOlder
|
2022-02-10 20:34:41 +00:00
|
|
|
, urllib3
|
2021-03-09 03:18:52 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "requests";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "2.31.0";
|
2023-01-20 10:41:00 +00:00
|
|
|
format = "setuptools";
|
2023-02-02 18:25:31 +00:00
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
2022-09-14 18:05:37 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-lCxadY+Y15Dq7Ropy27vx/+w0c968Fw9J5Flbb1q0eE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-06-26 10:26:21 +00:00
|
|
|
brotlicffi
|
2021-03-09 03:18:52 +00:00
|
|
|
certifi
|
2022-06-26 10:26:21 +00:00
|
|
|
charset-normalizer
|
2021-03-09 03:18:52 +00:00
|
|
|
idna
|
|
|
|
urllib3
|
|
|
|
];
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
security = [];
|
|
|
|
socks = [
|
|
|
|
pysocks
|
|
|
|
];
|
|
|
|
use_chardet_on_py3 = [
|
|
|
|
chardet
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-03-09 03:18:52 +00:00
|
|
|
pytest-mock
|
|
|
|
pytest-xdist
|
|
|
|
pytestCheckHook
|
2022-06-26 10:26:21 +00:00
|
|
|
]
|
|
|
|
++ passthru.optional-dependencies.socks;
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Disable tests that require network access and use httpbin
|
|
|
|
"requests.api.request"
|
|
|
|
"requests.models.PreparedRequest"
|
|
|
|
"requests.sessions.Session"
|
|
|
|
"requests"
|
|
|
|
"test_redirecting_to_bad_url"
|
|
|
|
"test_requests_are_updated_each_time"
|
|
|
|
"test_should_bypass_proxies_pass_only_hostname"
|
|
|
|
"test_urllib3_pool_connection_closed"
|
|
|
|
"test_urllib3_retries"
|
|
|
|
"test_use_proxy_from_environment"
|
|
|
|
"TestRequests"
|
|
|
|
"TestTimeout"
|
2022-04-27 09:35:20 +00:00
|
|
|
] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
|
|
|
|
# Fatal Python error: Aborted
|
|
|
|
"test_basic_response"
|
|
|
|
"test_text_response"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
|
|
|
|
# Fatal Python error: Aborted
|
|
|
|
"tests/test_lowlevel.py"
|
2021-03-09 03:18:52 +00:00
|
|
|
];
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"requests"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-02-10 20:34:41 +00:00
|
|
|
description = "HTTP library for Python";
|
|
|
|
homepage = "http://docs.python-requests.org/";
|
2023-02-02 18:25:31 +00:00
|
|
|
changelog = "https://github.com/psf/requests/blob/v${version}/HISTORY.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2021-03-09 03:18:52 +00:00
|
|
|
maintainers = with maintainers; [ fab ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|