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