From 5a673d3c05a79940dea48662ebea2ac4b39fa432 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Sun, 29 Dec 2019 13:05:45 -0500 Subject: [PATCH] python3Packages.httpx: init at 0.9.5 --- .../python-modules/httpx/default.nix | 68 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 70 insertions(+) create mode 100644 pkgs/development/python-modules/httpx/default.nix diff --git a/pkgs/development/python-modules/httpx/default.nix b/pkgs/development/python-modules/httpx/default.nix new file mode 100644 index 000000000000..04a0592d7506 --- /dev/null +++ b/pkgs/development/python-modules/httpx/default.nix @@ -0,0 +1,68 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, certifi +, hstspreload +, chardet +, h11 +, h2 +, idna +, rfc3986 +, sniffio +, isPy27 +, pytest +, pytestcov +, trustme +, uvicorn +, trio +, brotli +}: + +buildPythonPackage rec { + pname = "httpx"; + version = "0.9.5"; + disabled = isPy27; + + src = fetchFromGitHub { + owner = "encode"; + repo = pname; + rev = version; + sha256 = "140z2j7b5hlcxvfb433hqv5b8irqa88hpq33lzr9m992djbhj2hb"; + }; + + propagatedBuildInputs = [ + certifi + hstspreload + chardet + h11 + h2 + idna + rfc3986 + sniffio + ]; + + checkInputs = [ + pytest + pytestcov + trustme + uvicorn + trio + brotli + ]; + + postPatch = '' + substituteInPlace setup.py \ + --replace "h11==0.8.*" "h11" + ''; + + checkPhase = '' + PYTHONPATH=.:$PYTHONPATH pytest + ''; + + meta = with lib; { + description = "The next generation HTTP client"; + homepage = https://github.com/encode/httpx; + license = licenses.bsd3; + maintainers = [ maintainers.costrouc ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f82ab9229aab..d80a71b3187c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2620,6 +2620,8 @@ in { httpauth = callPackage ../development/python-modules/httpauth { }; + httpx = callPackage ../development/python-modules/httpx { }; + idna-ssl = callPackage ../development/python-modules/idna-ssl { }; identify = callPackage ../development/python-modules/identify { };