about summary refs log tree commit diff
path: root/pkgs/development/python-modules/httpx/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/httpx/default.nix')
-rw-r--r--pkgs/development/python-modules/httpx/default.nix25
1 files changed, 20 insertions, 5 deletions
diff --git a/pkgs/development/python-modules/httpx/default.nix b/pkgs/development/python-modules/httpx/default.nix
index 543308a3fdc12..d479cc1f13ced 100644
--- a/pkgs/development/python-modules/httpx/default.nix
+++ b/pkgs/development/python-modules/httpx/default.nix
@@ -1,11 +1,11 @@
 { lib
+, async_generator
 , buildPythonPackage
 , pythonOlder
 , fetchFromGitHub
 , brotlicffi
 , certifi
 , charset-normalizer
-, h2
 , httpcore
 , rfc3986
 , sniffio
@@ -20,24 +20,27 @@
 
 buildPythonPackage rec {
   pname = "httpx";
-  version = "0.21.1";
+  version = "0.21.3";
+  format = "setuptools";
+
   disabled = pythonOlder "3.6";
 
   src = fetchFromGitHub {
     owner = "encode";
     repo = pname;
     rev = version;
-    sha256 = "sha256-ayhLP+1hPWAx2ds227CKp5cebVkD5B2Z59L+3dzdINc=";
+    sha256 = "01069b0kj6vnb26xazlz06rj4yncy5nkq76pajvzx0pmpjkniiz9";
   };
 
   propagatedBuildInputs = [
     brotlicffi
     certifi
     charset-normalizer
-    h2
     httpcore
     rfc3986
     sniffio
+  ] ++ lib.optionals (pythonOlder "3.7") [
+    async_generator
   ];
 
   checkInputs = [
@@ -49,13 +52,21 @@ buildPythonPackage rec {
     uvicorn
   ];
 
-  pythonImportsCheck = [ "httpx" ];
+  postPatch = ''
+    substituteInPlace setup.py \
+      --replace "rfc3986[idna2008]>=1.3,<2" "rfc3986>=1.3"
+  '';
 
   # testsuite wants to find installed packages for testing entrypoint
   preCheck = ''
     export PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH
   '';
 
+  pytestFlagsArray = [
+    "-W"
+    "ignore::DeprecationWarning"
+  ];
+
   disabledTests = [
     # httpcore.ConnectError: [Errno 101] Network is unreachable
     "test_connect_timeout"
@@ -71,6 +82,10 @@ buildPythonPackage rec {
     "tests/test_main.py"
   ];
 
+  pythonImportsCheck = [
+    "httpx"
+  ];
+
   __darwinAllowLocalNetworking = true;
 
   meta = with lib; {