2020-10-28 19:43:51 +00:00
|
|
|
{ lib
|
2021-06-12 20:20:55 +00:00
|
|
|
, anyio
|
2022-06-02 23:27:27 +00:00
|
|
|
, buildPythonPackage
|
2021-11-29 16:58:25 +00:00
|
|
|
, certifi
|
2022-06-02 23:27:27 +00:00
|
|
|
, fetchFromGitHub
|
2020-08-27 21:36:12 +00:00
|
|
|
, h11
|
2020-10-28 19:43:51 +00:00
|
|
|
, h2
|
|
|
|
, pproxy
|
2021-04-21 22:17:47 +00:00
|
|
|
, pytest-asyncio
|
2021-11-29 16:58:25 +00:00
|
|
|
, pytest-httpbin
|
2022-06-02 23:27:27 +00:00
|
|
|
, pytest-trio
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
2020-08-27 21:36:12 +00:00
|
|
|
, sniffio
|
2022-03-02 21:42:01 +00:00
|
|
|
, socksio
|
2020-08-27 21:36:12 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "httpcore";
|
2022-06-02 23:27:27 +00:00
|
|
|
version = "0.15.0";
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-08-27 21:36:12 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "encode";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-06-02 23:27:27 +00:00
|
|
|
hash = "sha256-FF3Yzac9nkVcA5bHVOz2ymvOelSfJ0K6oU8UWpBDcmo=";
|
2020-08-27 21:36:12 +00:00
|
|
|
};
|
|
|
|
|
2022-03-02 21:42:01 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "h11>=0.11,<0.13" "h11>=0.11,<0.14"
|
|
|
|
'';
|
|
|
|
|
2020-10-28 19:43:51 +00:00
|
|
|
propagatedBuildInputs = [
|
2021-06-12 20:20:55 +00:00
|
|
|
anyio
|
2021-11-29 16:58:25 +00:00
|
|
|
certifi
|
2020-10-28 19:43:51 +00:00
|
|
|
h11
|
|
|
|
sniffio
|
|
|
|
];
|
|
|
|
|
2022-05-22 14:26:11 +00:00
|
|
|
passthru.optional-dependencies = {
|
2022-06-02 23:27:27 +00:00
|
|
|
http2 = [
|
|
|
|
h2
|
|
|
|
];
|
|
|
|
socks = [
|
|
|
|
socksio
|
|
|
|
];
|
2022-05-05 06:01:23 +00:00
|
|
|
};
|
|
|
|
|
2020-10-28 19:43:51 +00:00
|
|
|
checkInputs = [
|
|
|
|
pproxy
|
2021-04-21 22:17:47 +00:00
|
|
|
pytest-asyncio
|
2021-11-29 16:58:25 +00:00
|
|
|
pytest-httpbin
|
2022-06-02 23:27:27 +00:00
|
|
|
pytest-trio
|
|
|
|
pytestCheckHook
|
2022-05-22 14:26:11 +00:00
|
|
|
] ++ passthru.optional-dependencies.http2
|
|
|
|
++ passthru.optional-dependencies.socks;
|
2020-10-28 19:43:51 +00:00
|
|
|
|
2022-06-02 23:27:27 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"httpcore"
|
|
|
|
];
|
|
|
|
|
|
|
|
pytestFlagsArray = [
|
|
|
|
"--asyncio-mode=strict"
|
|
|
|
];
|
2020-08-27 21:36:12 +00:00
|
|
|
|
2020-10-28 19:43:51 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A minimal low-level HTTP client";
|
2020-08-27 21:36:12 +00:00
|
|
|
homepage = "https://github.com/encode/httpcore";
|
|
|
|
license = licenses.bsd3;
|
2020-10-28 19:43:51 +00:00
|
|
|
maintainers = with maintainers; [ ris ];
|
2020-08-27 21:36:12 +00:00
|
|
|
};
|
|
|
|
}
|