Something went wrong. Try again.
Nix Packages collection & NixOS github.com/NixOS/nixpkgs
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103{ lib, stdenv, buildPythonPackage, fetchFromGitHub,
# build-system hatchling, hatch-fancy-pypi-readme, uv-dynamic-versioning,
# dependencies h11, truststore,
# optional dependencies h2, socksio, trio, anyio,
# tests pytestCheckHook, pytest-httpbin, pytest-trio,
# reverse deps httpx2,}:
buildPythonPackage (finalAttrs: { pname = "httpcore2"; version = "2.13.1"; pyproject = true;
src = fetchFromGitHub { owner = "pydantic"; repo = "httpx2"; tag = "v${finalAttrs.version}"; hash = "sha256-XgjFiSwc4xCyPJcTB/Exh838fUOKsT0JRrha7s70C50="; };
postPatch = '' pushd src/httpcore2 '';
build-system = [ hatchling hatch-fancy-pypi-readme uv-dynamic-versioning ];
dependencies = [ h11 truststore ];
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" ];
# Skip tests does not pass: 10ms cancellation-timing test disabledTests = lib.optionals stdenv.hostPlatform.isRiscV64 [ "test_h2_timeout_during_request" "test_h2_timeout_during_response" ];
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 ]; };})