forked from mirrors/nixpkgs
python3Packages.httpx: 0.14.2 -> 0.16.1
Clean up package and convert tests to pytestCheckHook.
This commit is contained in:
parent
fed1b43c6f
commit
7f096a9feb
|
@ -1,71 +1,61 @@
|
||||||
{ lib
|
{ lib
|
||||||
, buildPythonPackage
|
, buildPythonPackage
|
||||||
|
, pythonOlder
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, fetchpatch
|
, brotli
|
||||||
, certifi
|
, certifi
|
||||||
, chardet
|
|
||||||
, h11
|
|
||||||
, h2
|
, h2
|
||||||
, httpcore
|
, httpcore
|
||||||
, idna
|
|
||||||
, rfc3986
|
, rfc3986
|
||||||
, sniffio
|
, sniffio
|
||||||
, isPy27
|
, pytestCheckHook
|
||||||
, pytest
|
|
||||||
, pytest-asyncio
|
, pytest-asyncio
|
||||||
, pytest-trio
|
, pytest-trio
|
||||||
, pytestcov
|
, pytestcov
|
||||||
, trustme
|
, trustme
|
||||||
, uvicorn
|
, uvicorn
|
||||||
, brotli
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "httpx";
|
pname = "httpx";
|
||||||
version = "0.14.2";
|
version = "0.16.1";
|
||||||
disabled = isPy27;
|
disabled = pythonOlder "3.6";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "encode";
|
owner = "encode";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
rev = version;
|
rev = version;
|
||||||
sha256 = "08b6k5g8car3bic90aw4ysb2zvsa5nm8qk3hk4dgamllnnxzl5br";
|
sha256 = "00gmq45fckcqkj910bvd7pyqz1mvgsdvz4s0k7dzbnc5czzq1f4a";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [
|
|
||||||
(fetchpatch {
|
|
||||||
name = "fix-cookie-test-timestamp.patch";
|
|
||||||
url = "https://github.com/encode/httpx/pull/1270.patch";
|
|
||||||
sha256 = "1hgrynac6226sgnyzmsr1nr15rn49gbfmk4c2kx3dwkbh6vr7jpd";
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
|
brotli
|
||||||
certifi
|
certifi
|
||||||
chardet
|
|
||||||
h11
|
|
||||||
h2
|
h2
|
||||||
httpcore
|
httpcore
|
||||||
idna
|
|
||||||
rfc3986
|
rfc3986
|
||||||
sniffio
|
sniffio
|
||||||
];
|
];
|
||||||
|
|
||||||
checkInputs = [
|
checkInputs = [
|
||||||
pytest
|
pytestCheckHook
|
||||||
pytest-asyncio
|
pytest-asyncio
|
||||||
pytest-trio
|
pytest-trio
|
||||||
pytestcov
|
pytestcov
|
||||||
trustme
|
trustme
|
||||||
uvicorn
|
uvicorn
|
||||||
brotli
|
|
||||||
];
|
];
|
||||||
|
|
||||||
checkPhase = ''
|
|
||||||
PYTHONPATH=.:$PYTHONPATH pytest -k 'not (test_connect_timeout or test_elapsed_timer)'
|
|
||||||
'';
|
|
||||||
pythonImportsCheck = [ "httpx" ];
|
pythonImportsCheck = [ "httpx" ];
|
||||||
|
|
||||||
|
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"
|
||||||
|
];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "The next generation HTTP client";
|
description = "The next generation HTTP client";
|
||||||
homepage = "https://github.com/encode/httpx";
|
homepage = "https://github.com/encode/httpx";
|
||||||
|
|
Loading…
Reference in a new issue