2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
2022-10-21 18:38:19 +00:00
|
|
|
, stdenv
|
2024-01-13 08:15:51 +00:00
|
|
|
, anyio
|
2022-06-26 10:26:21 +00:00
|
|
|
, brotli
|
|
|
|
, brotlicffi
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, certifi
|
2022-06-26 10:26:21 +00:00
|
|
|
, chardet
|
|
|
|
, click
|
|
|
|
, fetchFromGitHub
|
2022-05-18 14:49:53 +00:00
|
|
|
, h2
|
2022-12-17 10:02:37 +00:00
|
|
|
, hatch-fancy-pypi-readme
|
|
|
|
, hatchling
|
2022-06-26 10:26:21 +00:00
|
|
|
, httpcore
|
2024-01-13 08:15:51 +00:00
|
|
|
, idna
|
2022-05-18 14:49:53 +00:00
|
|
|
, isPyPy
|
2022-12-17 10:02:37 +00:00
|
|
|
, multipart
|
2022-05-18 14:49:53 +00:00
|
|
|
, pygments
|
2021-12-26 17:43:05 +00:00
|
|
|
, python
|
2022-06-26 10:26:21 +00:00
|
|
|
, pythonOlder
|
|
|
|
, rich
|
|
|
|
, sniffio
|
|
|
|
, socksio
|
2020-11-03 02:18:15 +00:00
|
|
|
, pytestCheckHook
|
2020-09-25 04:45:31 +00:00
|
|
|
, pytest-asyncio
|
|
|
|
, pytest-trio
|
2020-04-24 23:36:52 +00:00
|
|
|
, trustme
|
|
|
|
, uvicorn
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "httpx";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "0.26.0";
|
2022-12-17 10:02:37 +00:00
|
|
|
format = "pyproject";
|
2022-02-10 20:34:41 +00:00
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "encode";
|
|
|
|
repo = pname;
|
2023-03-15 16:39:30 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-qMMx1CYu2/yH4NRvZFzJOflAPIbcvMYJqU4r+chuzl0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
hatch-fancy-pypi-readme
|
|
|
|
hatchling
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
2024-01-13 08:15:51 +00:00
|
|
|
anyio
|
2020-04-24 23:36:52 +00:00
|
|
|
certifi
|
2020-09-25 04:45:31 +00:00
|
|
|
httpcore
|
2024-01-13 08:15:51 +00:00
|
|
|
idna
|
2020-04-24 23:36:52 +00:00
|
|
|
sniffio
|
|
|
|
];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
passthru.optional-dependencies = {
|
2022-06-26 10:26:21 +00:00
|
|
|
http2 = [
|
|
|
|
h2
|
|
|
|
];
|
|
|
|
socks = [
|
|
|
|
socksio
|
|
|
|
];
|
|
|
|
brotli = if isPyPy then [
|
|
|
|
brotlicffi
|
|
|
|
] else [
|
|
|
|
brotli
|
|
|
|
];
|
|
|
|
cli = [
|
|
|
|
click
|
|
|
|
rich
|
|
|
|
pygments
|
|
|
|
];
|
2022-05-18 14:49:53 +00:00
|
|
|
};
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
# trustme uses pyopenssl
|
|
|
|
doCheck = !(stdenv.isDarwin && stdenv.isAarch64);
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-06-26 10:26:21 +00:00
|
|
|
chardet
|
2022-12-17 10:02:37 +00:00
|
|
|
multipart
|
2020-11-03 02:18:15 +00:00
|
|
|
pytestCheckHook
|
2020-09-25 04:45:31 +00:00
|
|
|
pytest-asyncio
|
|
|
|
pytest-trio
|
2020-04-24 23:36:52 +00:00
|
|
|
trustme
|
|
|
|
uvicorn
|
2024-01-13 08:15:51 +00:00
|
|
|
] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-26 17:43:05 +00:00
|
|
|
# testsuite wants to find installed packages for testing entrypoint
|
|
|
|
preCheck = ''
|
|
|
|
export PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH
|
|
|
|
'';
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
pytestFlagsArray = [
|
2023-03-15 16:39:30 +00:00
|
|
|
"-W" "ignore::DeprecationWarning"
|
|
|
|
"-W" "ignore::trio.TrioDeprecationWarning"
|
2022-02-10 20:34:41 +00:00
|
|
|
];
|
|
|
|
|
2020-11-03 02:18:15 +00: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"
|
2021-12-26 17:43:05 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
"tests/test_main.py"
|
2020-11-03 02:18:15 +00:00
|
|
|
];
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"httpx"
|
|
|
|
];
|
|
|
|
|
2021-01-09 10:05:03 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2022-12-17 10:02:37 +00:00
|
|
|
changelog = "https://github.com/encode/httpx/blob/${src.rev}/CHANGELOG.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "The next generation HTTP client";
|
|
|
|
homepage = "https://github.com/encode/httpx";
|
|
|
|
license = licenses.bsd3;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ fab ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|