2019-12-29 18:05:45 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2020-10-28 19:54:55 +00:00
|
|
|
, pythonOlder
|
2019-12-29 18:05:45 +00:00
|
|
|
, fetchFromGitHub
|
2020-10-28 19:54:55 +00:00
|
|
|
, brotli
|
2019-12-29 18:05:45 +00:00
|
|
|
, certifi
|
|
|
|
, h2
|
2020-08-27 23:08:49 +01:00
|
|
|
, httpcore
|
2019-12-29 18:05:45 +00:00
|
|
|
, rfc3986
|
|
|
|
, sniffio
|
2020-10-28 19:54:55 +00:00
|
|
|
, pytestCheckHook
|
2020-08-27 23:08:49 +01:00
|
|
|
, pytest-asyncio
|
|
|
|
, pytest-trio
|
2019-12-29 18:05:45 +00:00
|
|
|
, pytestcov
|
|
|
|
, trustme
|
|
|
|
, uvicorn
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "httpx";
|
2021-02-28 22:19:08 +00:00
|
|
|
version = "0.17.0";
|
2020-10-28 19:54:55 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2019-12-29 18:05:45 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "encode";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-02-28 22:19:08 +00:00
|
|
|
sha256 = "sha256-pRdhPAxKZOVbRhOm4881Dn+IRtpX5T3oFuYdtWp3cgY=";
|
2019-12-29 18:05:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2020-10-28 19:54:55 +00:00
|
|
|
brotli
|
2019-12-29 18:05:45 +00:00
|
|
|
certifi
|
|
|
|
h2
|
2020-08-27 23:08:49 +01:00
|
|
|
httpcore
|
2019-12-29 18:05:45 +00:00
|
|
|
rfc3986
|
|
|
|
sniffio
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
2020-10-28 19:54:55 +00:00
|
|
|
pytestCheckHook
|
2020-08-27 23:08:49 +01:00
|
|
|
pytest-asyncio
|
|
|
|
pytest-trio
|
2019-12-29 18:05:45 +00:00
|
|
|
pytestcov
|
|
|
|
trustme
|
|
|
|
uvicorn
|
|
|
|
];
|
|
|
|
|
2020-08-27 23:08:49 +01:00
|
|
|
pythonImportsCheck = [ "httpx" ];
|
2019-12-29 18:05:45 +00:00
|
|
|
|
2020-10-28 19:54:55 +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-05 23:14:51 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2019-12-29 18:05:45 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "The next generation HTTP client";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/encode/httpx";
|
2019-12-29 18:05:45 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.costrouc ];
|
|
|
|
};
|
|
|
|
}
|