|
|
|
@ -1,11 +1,11 @@ |
|
|
|
|
{ lib |
|
|
|
|
, async_generator |
|
|
|
|
, buildPythonPackage |
|
|
|
|
, pythonOlder |
|
|
|
|
, fetchFromGitHub |
|
|
|
|
, brotlicffi |
|
|
|
|
, certifi |
|
|
|
|
, charset-normalizer |
|
|
|
|
, h2 |
|
|
|
|
, httpcore |
|
|
|
|
, rfc3986 |
|
|
|
|
, sniffio |
|
|
|
@ -21,6 +21,8 @@ |
|
|
|
|
buildPythonPackage rec { |
|
|
|
|
pname = "httpx"; |
|
|
|
|
version = "0.21.3"; |
|
|
|
|
format = "setuptools"; |
|
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.6"; |
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub { |
|
|
|
@ -34,10 +36,11 @@ buildPythonPackage rec { |
|
|
|
|
brotlicffi |
|
|
|
|
certifi |
|
|
|
|
charset-normalizer |
|
|
|
|
h2 |
|
|
|
|
httpcore |
|
|
|
|
rfc3986 |
|
|
|
|
sniffio |
|
|
|
|
] ++ lib.optionals (pythonOlder "3.7") [ |
|
|
|
|
async_generator |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
checkInputs = [ |
|
|
|
@ -49,13 +52,21 @@ buildPythonPackage rec { |
|
|
|
|
uvicorn |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "httpx" ]; |
|
|
|
|
postPatch = '' |
|
|
|
|
substituteInPlace setup.py \ |
|
|
|
|
--replace "rfc3986[idna2008]>=1.3,<2" "rfc3986>=1.3" |
|
|
|
|
''; |
|
|
|
|
|
|
|
|
|
# testsuite wants to find installed packages for testing entrypoint |
|
|
|
|
preCheck = '' |
|
|
|
|
export PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH |
|
|
|
|
''; |
|
|
|
|
|
|
|
|
|
pytestFlagsArray = [ |
|
|
|
|
"-W" |
|
|
|
|
"ignore::DeprecationWarning" |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
disabledTests = [ |
|
|
|
|
# httpcore.ConnectError: [Errno 101] Network is unreachable |
|
|
|
|
"test_connect_timeout" |
|
|
|
@ -71,6 +82,10 @@ buildPythonPackage rec { |
|
|
|
|
"tests/test_main.py" |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
pythonImportsCheck = [ |
|
|
|
|
"httpx" |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
__darwinAllowLocalNetworking = true; |
|
|
|
|
|
|
|
|
|
meta = with lib; { |
|
|
|
|