Unverified Commit a438c4b9 authored by Martin Weinelt's avatar Martin Weinelt Committed by GitHub
Browse files

python3Packages.aiomodernforms: replace async-timeout with asyncio.timeout (#461133)

parents 2d3442c3 07e7f6f5
Loading
Loading
Loading
Loading
+16 −7
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch,
  setuptools,
  aiohttp,
  backoff,
  yarl,
@@ -13,7 +15,7 @@
buildPythonPackage rec {
  pname = "aiomodernforms";
  version = "0.1.8";
  format = "setuptools";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "wonderslug";
@@ -22,13 +24,18 @@ buildPythonPackage rec {
    hash = "sha256-Vx51WBjjNPIfLlwMnAuwHnGNljhnjKkU0tWB9M9rjsw=";
  };

  postPatch = ''
    substituteInPlace aiomodernforms/modernforms.py --replace-fail \
      "with async_timeout.timeout(self._request_timeout):" \
      "async with async_timeout.timeout(self._request_timeout):"
  '';
  patches = [
    # https://github.com/wonderslug/aiomodernforms/pull/274
    (fetchpatch {
      name = "replace-async-timeout-with-asyncio.timeout.patch";
      url = "https://github.com/wonderslug/aiomodernforms/commit/61f1330b2fc244565fd97ae392b9778faa1bab09.patch";
      hash = "sha256-7sy5/HgPYgVpULgeEu3tFBa2iXIskAqcarf0RndxTpE=";
    })
  ];

  build-system = [ setuptools ];

  propagatedBuildInputs = [
  dependencies = [
    aiohttp
    backoff
    yarl
@@ -46,6 +53,8 @@ buildPythonPackage rec {
    "test_empty_response"
  ];

  __darwinAllowLocalNetworking = true;

  pythonImportsCheck = [ "aiomodernforms" ];

  meta = with lib; {