Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / httpcore / default.nix
blob212db973e9e0a5893427bd9ad694a7f6873001cf
1 { lib
2 , anyio
3 , buildPythonPackage
4 , certifi
5 , fetchFromGitHub
6 , hatchling
7 , hatch-fancy-pypi-readme
8 , h11
9 , h2
10 , pproxy
11 , pytest-asyncio
12 , pytest-httpbin
13 , pytest-trio
14 , pytestCheckHook
15 , pythonOlder
16 , socksio
17 , trio
18 # for passthru.tests
19 , httpx
20 , httpx-socks
23 buildPythonPackage rec {
24   pname = "httpcore";
25   version = "1.0.4";
26   pyproject = true;
28   disabled = pythonOlder "3.8";
30   src = fetchFromGitHub {
31     owner = "encode";
32     repo = "httpcore";
33     rev = "refs/tags/${version}";
34     hash = "sha256-DK5avYEtQcTFogpdEjw0NB4qkzDm5cZKPjAE8MC6Sng=";
35   };
37   nativeBuildInputs = [
38     hatchling
39     hatch-fancy-pypi-readme
40   ];
42   propagatedBuildInputs = [
43     certifi
44     h11
45   ];
47   passthru.optional-dependencies = {
48     asyncio = [
49       anyio
50     ];
51     http2 = [
52       h2
53     ];
54     socks = [
55       socksio
56     ];
57     trio = [
58       trio
59     ];
60   };
62   nativeCheckInputs = [
63     pproxy
64     pytest-asyncio
65     pytest-httpbin
66     pytest-trio
67     pytestCheckHook
68   ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
70   pythonImportsCheck = [
71     "httpcore"
72   ];
74   __darwinAllowLocalNetworking = true;
76   passthru.tests = {
77     inherit httpx httpx-socks;
78   };
80   meta = with lib; {
81     changelog = "https://github.com/encode/httpcore/blob/${version}/CHANGELOG.md";
82     description = "A minimal low-level HTTP client";
83     homepage = "https://github.com/encode/httpcore";
84     license = licenses.bsd3;
85     maintainers = with maintainers; [ ris ];
86   };