python3Packages.httpcore2: init at 2.2.0
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
{
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
|
||||
# build-system
|
||||
hatchling,
|
||||
hatch-fancy-pypi-readme,
|
||||
uv-dynamic-versioning,
|
||||
|
||||
# dependencies
|
||||
certifi,
|
||||
h11,
|
||||
|
||||
# optional dependencies
|
||||
h2,
|
||||
socksio,
|
||||
trio,
|
||||
anyio,
|
||||
|
||||
# tests
|
||||
pytestCheckHook,
|
||||
pytest-httpbin,
|
||||
pytest-trio,
|
||||
|
||||
# reverse deps
|
||||
httpx2,
|
||||
}:
|
||||
|
||||
buildPythonPackage (finalAttrs: {
|
||||
pname = "httpcore2";
|
||||
version = "2.2.0";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "pydantic";
|
||||
repo = "httpx2";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-RdoMDF5XVOkb4JCmytdF0JmBfTUcHuM1N+SD8r+RNiU=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
pushd src/httpcore2
|
||||
'';
|
||||
|
||||
build-system = [
|
||||
hatchling
|
||||
hatch-fancy-pypi-readme
|
||||
uv-dynamic-versioning
|
||||
];
|
||||
|
||||
dependencies = [
|
||||
certifi
|
||||
h11
|
||||
];
|
||||
|
||||
optional-dependencies = {
|
||||
asyncio = [ anyio ];
|
||||
http2 = [ h2 ];
|
||||
socks = [ socksio ];
|
||||
trio = [ trio ];
|
||||
};
|
||||
|
||||
pythonImportsCheck = [
|
||||
"httpcore2"
|
||||
];
|
||||
|
||||
preCheck = ''
|
||||
popd
|
||||
'';
|
||||
|
||||
nativeCheckInputs = [
|
||||
pytestCheckHook
|
||||
pytest-httpbin
|
||||
pytest-trio
|
||||
]
|
||||
++ lib.concatAttrValues finalAttrs.passthru.optional-dependencies;
|
||||
|
||||
pytestFlags = [ "tests/httpcore2" ];
|
||||
|
||||
passthru.tests = {
|
||||
inherit httpx2;
|
||||
};
|
||||
|
||||
__darwinAllowLocalNetworking = true;
|
||||
__structuredAttrs = true;
|
||||
|
||||
meta = {
|
||||
description = "A next generation HTTP client for Python";
|
||||
homepage = "https://github.com/pydantic/httpx2";
|
||||
changelog = "https://github.com/pydantic/httpx2/blob/${finalAttrs.src.tag}/src/httpcore2/CHANGELOG.md";
|
||||
license = lib.licenses.bsd3;
|
||||
maintainers = with lib.maintainers; [ hexa ];
|
||||
};
|
||||
})
|
||||
@@ -7299,6 +7299,8 @@ self: super: with self; {
|
||||
|
||||
httpcore = callPackage ../development/python-modules/httpcore { };
|
||||
|
||||
httpcore2 = callPackage ../development/python-modules/httpcore2 { };
|
||||
|
||||
httpie = callPackage ../development/python-modules/httpie { };
|
||||
|
||||
httpie-ntlm = callPackage ../development/python-modules/httpie-ntlm { };
|
||||
|
||||
Reference in New Issue
Block a user