about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2022-01-15 16:12:48 +0100
committerMartin Weinelt <hexa@darmstadt.ccc.de>2022-01-23 01:09:31 +0100
commitc472377b3b7dedeb5ecc20304b160d70d59403d1 (patch)
tree24cab49adf44de0630e1dbf1a20ca3e8ba0cb17d
parent245cde952a184c59e340062104594b25bddd3eeb (diff)
python3Packages.httpx: ignore DeprecationWarning
-rw-r--r--pkgs/development/python-modules/httpx/default.nix21
1 files changed, 18 insertions, 3 deletions
diff --git a/pkgs/development/python-modules/httpx/default.nix b/pkgs/development/python-modules/httpx/default.nix
index 97b6affd3abb9..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
@@ -21,6 +21,8 @@
 buildPythonPackage rec {
   pname = "httpx";
   version = "0.21.3";
+  format = "setuptools";
+
   disabled = pythonOlder "3.6";
 
   src = fetchFromGitHub {
@@ -34,10 +36,11 @@ buildPythonPackage rec {
     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; {