From 84e7c77c2a31a19fe5a34a8a38a01989363ee868 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 8 May 2024 10:26:14 +0200 Subject: [PATCH 1/2] python312Packages.aiomcache: 0.8.1 -> 0.8.2 https://github.com/aio-libs/aiomcache/blob/v0.8.2/CHANGES.rst --- pkgs/development/python-modules/aiomcache/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/aiomcache/default.nix b/pkgs/development/python-modules/aiomcache/default.nix index d7315a0cd5e9..c5349ce13fc2 100644 --- a/pkgs/development/python-modules/aiomcache/default.nix +++ b/pkgs/development/python-modules/aiomcache/default.nix @@ -13,14 +13,14 @@ buildPythonPackage rec { pname = "aiomcache"; - version = "0.8.1"; + version = "0.8.2"; pyproject = true; src = fetchFromGitHub { owner = "aio-libs"; repo = "aiomcache"; rev = "v${version}"; - hash = "sha256-oRMN1seEjFSsq4wjkIXHM7Osq8y/5WFExGCEr6eM9vc="; + hash = "sha256-+rlKHDop0kNxJ0HoXROs/oyI4zE3MDyxXXhWZtVDMj4="; }; build-system = [ From ab6f01b8f832e275c59696e678653e4d8ddefc76 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 8 May 2024 10:52:41 +0200 Subject: [PATCH 2/2] python312Pacakges.aiocache: enable tests --- .../python-modules/aiocache/default.nix | 54 +++++++++++++++++-- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/aiocache/default.nix b/pkgs/development/python-modules/aiocache/default.nix index fd4e5f3a154a..5d78252791b3 100644 --- a/pkgs/development/python-modules/aiocache/default.nix +++ b/pkgs/development/python-modules/aiocache/default.nix @@ -1,8 +1,15 @@ { lib +, aiohttp +, aiomcache , buildPythonPackage , fetchFromGitHub +, marshmallow , msgpack +, pkgs , pythonOlder +, pytest-asyncio +, pytest-mock +, pytestCheckHook , redis , setuptools }: @@ -21,21 +28,60 @@ buildPythonPackage rec { hash = "sha256-yvXDNJL8uxReaU81klVWudJwh1hmvg5GeeILcNpm/YA="; }; - nativeBuildInputs = [ + postPatch = '' + substituteInPlace setup.cfg \ + --replace-fail "--cov=aiocache --cov=tests/ --cov-report term" "" + ''; + + build-system = [ setuptools ]; - passthru.optional-dependencies = { + optional-dependencies = { redis = [ redis ]; + memcached = [ + aiomcache + ]; msgpack = [ msgpack ]; }; - # aiomcache would be required but last release was in 2017 - doCheck = false; + nativeCheckInputs = [ + aiohttp + marshmallow + pytest-asyncio + pytest-mock + pytestCheckHook + ] ++ lib.flatten (lib.attrValues optional-dependencies); + + pytestFlagsArray = [ + "-W" "ignore::DeprecationWarning" + # TypeError: object MagicMock can't be used in 'await' expression + "--deselect=tests/ut/backends/test_redis.py::TestRedisBackend::test_close" + ]; + + disabledTests = [ + # calls apache benchmark and fails, no usable output + "test_concurrency_error_rates" + ]; + + preCheck = '' + ${lib.getBin pkgs.redis}/bin/redis-server & + REDIS_PID=$! + + ${lib.getBin pkgs.memcached}/bin/memcached & + MEMCACHED_PID=$! + ''; + + postCheck = '' + kill $REDIS_PID + kill $MEMCACHED_PID + ''; + + __darwinAllowLocalNetworking = true; pythonImportsCheck = [ "aiocache"