2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2020-11-03 02:18:15 +00:00
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
2020-11-03 02:18:15 +00:00
|
|
|
, brotli
|
2020-04-24 23:36:52 +00:00
|
|
|
, certifi
|
|
|
|
, h2
|
2020-09-25 04:45:31 +00:00
|
|
|
, httpcore
|
2020-04-24 23:36:52 +00:00
|
|
|
, rfc3986
|
|
|
|
, sniffio
|
2020-11-03 02:18:15 +00:00
|
|
|
, pytestCheckHook
|
2020-09-25 04:45:31 +00:00
|
|
|
, pytest-asyncio
|
|
|
|
, pytest-trio
|
2020-04-24 23:36:52 +00:00
|
|
|
, pytestcov
|
|
|
|
, trustme
|
|
|
|
, uvicorn
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "httpx";
|
2021-03-09 03:18:52 +00:00
|
|
|
version = "0.17.0";
|
2020-11-03 02:18:15 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "encode";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-03-09 03:18:52 +00:00
|
|
|
sha256 = "sha256-pRdhPAxKZOVbRhOm4881Dn+IRtpX5T3oFuYdtWp3cgY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2020-11-03 02:18:15 +00:00
|
|
|
brotli
|
2020-04-24 23:36:52 +00:00
|
|
|
certifi
|
|
|
|
h2
|
2020-09-25 04:45:31 +00:00
|
|
|
httpcore
|
2020-04-24 23:36:52 +00:00
|
|
|
rfc3986
|
|
|
|
sniffio
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
2020-11-03 02:18:15 +00:00
|
|
|
pytestCheckHook
|
2020-09-25 04:45:31 +00:00
|
|
|
pytest-asyncio
|
|
|
|
pytest-trio
|
2020-04-24 23:36:52 +00:00
|
|
|
pytestcov
|
|
|
|
trustme
|
|
|
|
uvicorn
|
|
|
|
];
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
pythonImportsCheck = [ "httpx" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
disabledTests = [
|
|
|
|
# httpcore.ConnectError: [Errno 101] Network is unreachable
|
|
|
|
"test_connect_timeout"
|
|
|
|
# httpcore.ConnectError: [Errno -2] Name or service not known
|
|
|
|
"test_async_proxy_close"
|
|
|
|
"test_sync_proxy_close"
|
|
|
|
];
|
|
|
|
|
2021-01-09 10:05:03 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "The next generation HTTP client";
|
|
|
|
homepage = "https://github.com/encode/httpx";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.costrouc ];
|
|
|
|
};
|
|
|
|
}
|