Files
2026-06-15 16:35:55 +02:00

67 lines
1.3 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=";
};
patches = [
# https://github.com/pnuckowski/aioresponses/issues/289
# https://github.com/pnuckowski/aioresponses/pull/292
./aiohttp-3.14-compat.patch
];
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;
};
}