summary refs log tree commit diff
path: root/pkgs/development/python-modules/aiohttp
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2021-02-27 13:05:52 +0100
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2021-02-27 12:21:18 +0000
commit48ebb82c32b78c700adda413dc921529050a9eed (patch)
tree6ce60f9c2c5b34b1f5cf7fa3016b12586908a3ef /pkgs/development/python-modules/aiohttp
parent0c98cef61305a4f46f114de249498e307598eb0c (diff)
downloadnixpkgs-48ebb82c32b78c700adda413dc921529050a9eed.tar
nixpkgs-48ebb82c32b78c700adda413dc921529050a9eed.tar.gz
nixpkgs-48ebb82c32b78c700adda413dc921529050a9eed.tar.bz2
nixpkgs-48ebb82c32b78c700adda413dc921529050a9eed.tar.lz
nixpkgs-48ebb82c32b78c700adda413dc921529050a9eed.tar.xz
nixpkgs-48ebb82c32b78c700adda413dc921529050a9eed.tar.zst
nixpkgs-48ebb82c32b78c700adda413dc921529050a9eed.zip
python3Packages.aiohttp: 3.7.3 -> 3.7.4
https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst#374-2021-02-25

Clean up package, reenable tests, allow local networking for darwin for
loopback network tests, actually enable xdist, disable coverage.

Fixes: CVE-2021-21330
Diffstat (limited to 'pkgs/development/python-modules/aiohttp')
-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 = ''