summary refs log tree commit diff
path: root/pkgs/development/python-modules/aiohttp/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/aiohttp/default.nix')
-rw-r--r--pkgs/development/python-modules/aiohttp/default.nix75
1 files changed, 35 insertions, 40 deletions
diff --git a/pkgs/development/python-modules/aiohttp/default.nix b/pkgs/development/python-modules/aiohttp/default.nix
index 514d1d308e1..c682423eec1 100644
--- a/pkgs/development/python-modules/aiohttp/default.nix
+++ b/pkgs/development/python-modules/aiohttp/default.nix
@@ -3,82 +3,77 @@
 , buildPythonPackage
 , fetchPypi
 , pythonOlder
+, async-timeout
 , attrs
 , chardet
-, multidict
-, async-timeout
-, yarl
 , idna-ssl
+, multidict
 , typing-extensions
-, pytestrunner
-, pytestCheckHook
-, gunicorn
+, yarl
 , async_generator
-, pytest_xdist
-, pytestcov
-, pytest-mock
-, trustme
 , brotlipy
 , freezegun
-, isPy38
+, gunicorn
+, pytest-mock
+, pytest-xdist
+, pytestCheckHook
 , re-assert
+, trustme
 }:
 
 buildPythonPackage rec {
   pname = "aiohttp";
-  version = "3.7.3";
-  # https://github.com/aio-libs/aiohttp/issues/4525 python3.8 failures
-  disabled = pythonOlder "3.5";
+  version = "3.7.4";
+  disabled = pythonOlder "3.6";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "9c1a81af067e72261c9cbe33ea792893e83bc6aa987bfbd6fdc1e5e7b22777c4";
+    sha256 = "1pn79h8fng4xi5gl1f6saw31nxgmgyxl41yf3vba1l21673yr12x";
   };
 
-  checkInputs = [
-    pytestrunner pytestCheckHook gunicorn async_generator pytest_xdist
-    pytest-mock pytestcov trustme brotlipy freezegun
-    re-assert
-  ];
+  postPatch = ''
+    substituteInPlace setup.cfg --replace " --cov=aiohttp" ""
+  '';
 
   propagatedBuildInputs = [
+    async-timeout
     attrs
     chardet
     multidict
-    async-timeout
     typing-extensions
     yarl
   ] ++ lib.optionals (pythonOlder "3.7") [
     idna-ssl
   ];
 
+  checkInputs = [
+    async_generator
+    brotlipy
+    freezegun
+    gunicorn
+    pytest-mock
+    pytest-xdist
+    pytestCheckHook
+    re-assert
+    trustme
+  ];
+
+  pytestFlagsArray = [
+    "-n auto"
+  ];
+
   disabledTests = [
-    # disable tests which attempt to do loopback connections
-    "get_valid_log_format_exc"
-    "test_access_logger_atoms"
-    "aiohttp_request_coroutine"
-    "server_close_keepalive_connection"
-    "connector"
-    "client_disconnect"
-    "handle_keepalive_on_closed_connection"
-    "proxy_https_bad_response"
-    "partially_applied_handler"
-    "middleware"
+    # Disable tests that require network access
     "test_mark_formdata_as_processed"
-    # no longer compatible with pytest>=6
-    "aiohttp_plugin_async_fixture"
   ] ++ lib.optionals stdenv.is32bit [
     "test_cookiejar"
-  ] ++ lib.optionals isPy38 [
-    # Python 3.8  https://github.com/aio-libs/aiohttp/issues/4525
-    "test_read_boundary_with_incomplete_chunk"
-    "test_read_incomplete_chunk"
-    "test_request_tracing_exception"
   ] ++ lib.optionals stdenv.isDarwin [
-    "test_addresses"  # https://github.com/aio-libs/aiohttp/issues/3572
+    "test_addresses"  # https://github.com/aio-libs/aiohttp/issues/3572, remove >= v4.0.0
     "test_close"
   ];
 
+  __darwinAllowLocalNetworking = true;
+
   # aiohttp in current folder shadows installed version
   # Probably because we run `python -m pytest` instead of `pytest` in the hook.
   preCheck = ''