2019-12-29 18:05:45 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2020-09-13 12:44:47 +01:00
|
|
|
, fetchpatch
|
2019-12-29 18:05:45 +00:00
|
|
|
, certifi
|
|
|
|
, chardet
|
|
|
|
, h11
|
|
|
|
, h2
|
2020-08-27 23:08:49 +01:00
|
|
|
, httpcore
|
2019-12-29 18:05:45 +00:00
|
|
|
, idna
|
|
|
|
, rfc3986
|
|
|
|
, sniffio
|
|
|
|
, isPy27
|
|
|
|
, pytest
|
2020-08-27 23:08:49 +01:00
|
|
|
, pytest-asyncio
|
|
|
|
, pytest-trio
|
2019-12-29 18:05:45 +00:00
|
|
|
, pytestcov
|
|
|
|
, trustme
|
|
|
|
, uvicorn
|
|
|
|
, brotli
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "httpx";
|
2020-08-27 23:08:49 +01:00
|
|
|
version = "0.14.2";
|
2019-12-29 18:05:45 +00:00
|
|
|
disabled = isPy27;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "encode";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2020-08-27 23:08:49 +01:00
|
|
|
sha256 = "08b6k5g8car3bic90aw4ysb2zvsa5nm8qk3hk4dgamllnnxzl5br";
|
2019-12-29 18:05:45 +00:00
|
|
|
};
|
|
|
|
|
2020-09-13 12:44:47 +01:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-cookie-test-timestamp.patch";
|
|
|
|
url = "https://github.com/encode/httpx/pull/1270.patch";
|
|
|
|
sha256 = "1hgrynac6226sgnyzmsr1nr15rn49gbfmk4c2kx3dwkbh6vr7jpd";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2019-12-29 18:05:45 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
certifi
|
|
|
|
chardet
|
|
|
|
h11
|
|
|
|
h2
|
2020-08-27 23:08:49 +01:00
|
|
|
httpcore
|
2019-12-29 18:05:45 +00:00
|
|
|
idna
|
|
|
|
rfc3986
|
|
|
|
sniffio
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytest
|
2020-08-27 23:08:49 +01:00
|
|
|
pytest-asyncio
|
|
|
|
pytest-trio
|
2019-12-29 18:05:45 +00:00
|
|
|
pytestcov
|
|
|
|
trustme
|
|
|
|
uvicorn
|
|
|
|
brotli
|
|
|
|
];
|
|
|
|
|
|
|
|
checkPhase = ''
|
2020-08-27 23:08:49 +01:00
|
|
|
PYTHONPATH=.:$PYTHONPATH pytest -k 'not (test_connect_timeout or test_elapsed_timer)'
|
2019-12-29 18:05:45 +00:00
|
|
|
'';
|
2020-08-27 23:08:49 +01:00
|
|
|
pythonImportsCheck = [ "httpx" ];
|
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 ];
|
|
|
|
};
|
|
|
|
}
|