about 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.nix146
1 files changed, 75 insertions, 71 deletions
diff --git a/pkgs/development/python-modules/aiohttp/default.nix b/pkgs/development/python-modules/aiohttp/default.nix
index e46b5989dd762..20d911edfbbaf 100644
--- a/pkgs/development/python-modules/aiohttp/default.nix
+++ b/pkgs/development/python-modules/aiohttp/default.nix
@@ -1,35 +1,37 @@
-{ lib
-, stdenv
-, buildPythonPackage
-, pythonOlder
-, fetchFromGitHub
-, substituteAll
-, llhttp
-# build_requires
-, cython
-, setuptools
-# install_requires
-, attrs
-, multidict
-, async-timeout
-, yarl
-, frozenlist
-, aiosignal
-, aiodns
-, brotli
-# tests_require
-, freezegun
-, gunicorn
-, pytest-mock
-, pytest7CheckHook
-, python-on-whales
-, re-assert
-, trustme
+{
+  lib,
+  stdenv,
+  buildPythonPackage,
+  pythonOlder,
+  fetchFromGitHub,
+  substituteAll,
+  llhttp,
+  python,
+  # build_requires
+  cython,
+  setuptools,
+  # install_requires
+  attrs,
+  multidict,
+  async-timeout,
+  yarl,
+  frozenlist,
+  aiosignal,
+  aiodns,
+  brotli,
+  # tests_require
+  freezegun,
+  gunicorn,
+  pytest-mock,
+  pytest7CheckHook,
+  python-on-whales,
+  re-assert,
+  trustme,
 }:
 
 buildPythonPackage rec {
   pname = "aiohttp";
-  version = "3.9.3";
+  version = "3.9.5";
   pyproject = true;
 
   disabled = pythonOlder "3.8";
@@ -38,7 +40,7 @@ buildPythonPackage rec {
     owner = "aio-libs";
     repo = "aiohttp";
     rev = "refs/tags/v${version}";
-    hash = "sha256-dEeMHruFJ1o0J6VUJcpUk7LhEC8sV8hUKXoKcd618lE=";
+    hash = "sha256-FRtirmwgU8v+ee3db7rOFsmy0rNW8A7+yRZC5d6uYNA=";
   };
 
   patches = [
@@ -57,7 +59,7 @@ buildPythonPackage rec {
     touch .git  # tools/gen.py uses .git to find the project root
   '';
 
-  nativeBuildInputs = [
+  build-system = [
     cython
     setuptools
   ];
@@ -66,7 +68,7 @@ buildPythonPackage rec {
     make cythonize
   '';
 
-  propagatedBuildInputs = [
+  dependencies = [
     attrs
     multidict
     async-timeout
@@ -77,41 +79,41 @@ buildPythonPackage rec {
     brotli
   ];
 
+  postInstall = ''
+    # remove source code file with reference to dev dependencies
+    rm $out/${python.sitePackages}/aiohttp/_cparser.pxd{,.orig}
+  '';
+
   # NOTE: pytest-xdist cannot be added because it is flaky. See https://github.com/NixOS/nixpkgs/issues/230597 for more info.
-  nativeCheckInputs = [
-    freezegun
-    gunicorn
-    pytest-mock
-    pytest7CheckHook
-    python-on-whales
-    re-assert
-  ] ++ lib.optionals (!(stdenv.isDarwin && stdenv.isAarch64)) [
-    # Optional test dependency. Depends indirectly on pyopenssl, which is
-    # broken on aarch64-darwin.
-    trustme
-  ];
+  nativeCheckInputs =
+    [
+      freezegun
+      gunicorn
+      pytest-mock
+      pytest7CheckHook
+      python-on-whales
+      re-assert
+    ]
+    ++ lib.optionals (!(stdenv.isDarwin && stdenv.isAarch64)) [
+      # Optional test dependency. Depends indirectly on pyopenssl, which is
+      # broken on aarch64-darwin.
+      trustme
+    ];
 
-  disabledTests = [
-    # Disable tests that require network access
-    "test_client_session_timeout_zero"
-    "test_mark_formdata_as_processed"
-    "test_requote_redirect_url_default"
-    # Disable tests that trigger deprecation warnings in pytest
-    "test_async_with_session"
-    "test_session_close_awaitable"
-    "test_close_run_until_complete_not_deprecated"
-    # https://github.com/aio-libs/aiohttp/issues/7130
-    "test_static_file_if_none_match"
-    "test_static_file_if_match"
-    "test_static_file_if_modified_since_past_date"
-    # don't run benchmarks
-    "test_import_time"
-  ] ++ lib.optionals stdenv.is32bit [
-    "test_cookiejar"
-  ] ++ lib.optionals stdenv.isDarwin [
-    "test_addresses"  # https://github.com/aio-libs/aiohttp/issues/3572, remove >= v4.0.0
-    "test_close"
-  ];
+  disabledTests =
+    [
+      # Disable tests that require network access
+      "test_client_session_timeout_zero"
+      "test_mark_formdata_as_processed"
+      "test_requote_redirect_url_default"
+      # don't run benchmarks
+      "test_import_time"
+    ]
+    ++ lib.optionals stdenv.is32bit [ "test_cookiejar" ]
+    ++ lib.optionals stdenv.isDarwin [
+      "test_addresses" # https://github.com/aio-libs/aiohttp/issues/3572, remove >= v4.0.0
+      "test_close"
+    ];
 
   disabledTestPaths = [
     "tests/test_proxy_functional.py" # FIXME package proxy.py
@@ -120,13 +122,15 @@ buildPythonPackage rec {
   __darwinAllowLocalNetworking = true;
 
   # aiohttp in current folder shadows installed version
-  preCheck = ''
-    rm -r aiohttp
-    touch tests/data.unknown_mime_type # has to be modified after 1 Jan 1990
-  '' + lib.optionalString stdenv.isDarwin ''
-    # Work around "OSError: AF_UNIX path too long"
-    export TMPDIR="/tmp"
-  '';
+  preCheck =
+    ''
+      rm -r aiohttp
+      touch tests/data.unknown_mime_type # has to be modified after 1 Jan 1990
+    ''
+    + lib.optionalString stdenv.isDarwin ''
+      # Work around "OSError: AF_UNIX path too long"
+      export TMPDIR="/tmp"
+    '';
 
   meta = with lib; {
     changelog = "https://github.com/aio-libs/aiohttp/blob/v${version}/CHANGES.rst";