2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
brotlicffi,
|
|
|
|
buildPythonPackage,
|
|
|
|
certifi,
|
|
|
|
chardet,
|
|
|
|
charset-normalizer,
|
|
|
|
fetchPypi,
|
|
|
|
idna,
|
|
|
|
pysocks,
|
|
|
|
pytest-mock,
|
|
|
|
pytest-xdist,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
urllib3,
|
2021-03-09 03:18:52 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "requests";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "2.32.3";
|
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;
|
2024-06-20 14:57:18 +00:00
|
|
|
hash = "sha256-VTZUF3NOsYJVWQqf+euX6eHaho1MzWQCOZ6vaK8gp2A=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
patches = [
|
|
|
|
# https://github.com/psf/requests/issues/6730
|
|
|
|
# https://github.com/psf/requests/pull/6731
|
|
|
|
./ca-load-regression.patch
|
|
|
|
];
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
dependencies = [
|
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
|
|
|
|
];
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
optional-dependencies = {
|
2024-06-05 15:53:02 +00:00
|
|
|
security = [ ];
|
|
|
|
socks = [ pysocks ];
|
|
|
|
use_chardet_on_py3 = [ chardet ];
|
2022-06-26 10:26:21 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-03-09 03:18:52 +00:00
|
|
|
pytest-mock
|
|
|
|
pytest-xdist
|
|
|
|
pytestCheckHook
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ optional-dependencies.socks;
|
2021-03-09 03:18:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +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"
|
|
|
|
]
|
2024-09-26 11:04:55 +00:00
|
|
|
++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
|
2024-06-05 15:53:02 +00:00
|
|
|
# Fatal Python error: Aborted
|
|
|
|
"test_basic_response"
|
|
|
|
"test_text_response"
|
|
|
|
];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
disabledTestPaths = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
|
2022-04-27 09:35:20 +00:00
|
|
|
# Fatal Python error: Aborted
|
|
|
|
"tests/test_lowlevel.py"
|
2021-03-09 03:18:52 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +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
|
|
|
};
|
|
|
|
}
|