Files
nixpkgs/pkgs/development/python-modules/aioresponses/default.nix
Robert Schütz 16a3ce8d1b python314Packages.aioresponses: fix DeprecationWarning
The tests of e.g. aiohasupervisor previously failed with

    DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead
2026-03-03 22:04:00 -08:00

61 lines
1.2 KiB
Nix

{
lib,
buildPythonPackage,
fetchPypi,
# build-system
pbr,
setuptools,
# dependencies
aiohttp,
# tests
ddt,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "aioresponses";
version = "0.7.8";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-uGHN/l3FjzuK+sewppc9XXsstgjdD2JT0WuO6Or23xE=";
};
postPatch = ''
# https://github.com/pnuckowski/aioresponses/pull/278
substituteInPlace aioresponses/core.py \
--replace-fail asyncio.iscoroutinefunction inspect.iscoroutinefunction
'';
nativeBuildInputs = [
pbr
setuptools
];
propagatedBuildInputs = [ aiohttp ];
pythonImportsCheck = [ "aioresponses" ];
nativeCheckInputs = [
ddt
pytestCheckHook
];
disabledTests = [
# Skip tests which make requests to httpbin.org
"test_address_as_instance_of_url_combined_with_pass_through"
"test_pass_through_with_origin_params"
"test_pass_through_unmatched_requests"
];
meta = {
description = "Helper to mock/fake web requests in python aiohttp package";
homepage = "https://github.com/pnuckowski/aioresponses";
license = lib.licenses.mit;
};
}