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";
|
2020-10-28 19:54:55 +00:00
|
|
|
version = "0.16.1";
|
|
|
|
disabled = pythonOlder "3.6";
|
2019-12-29 18:05:45 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "encode";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2020-10-28 19:54:55 +00:00
|
|
|
sha256 = "00gmq45fckcqkj910bvd7pyqz1mvgsdvz4s0k7dzbnc5czzq1f4a";
|
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 ];
|
|
|
|
};
|
|
|
|
}
|