nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5
6 # build-system
7 pbr,
8 setuptools,
9
10 # dependencies
11 aiohttp,
12
13 # tests
14 ddt,
15 pytestCheckHook,
16}:
17
18buildPythonPackage rec {
19 pname = "aioresponses";
20 version = "0.7.8";
21 pyproject = true;
22
23 src = fetchPypi {
24 inherit pname version;
25 hash = "sha256-uGHN/l3FjzuK+sewppc9XXsstgjdD2JT0WuO6Or23xE=";
26 };
27
28 postPatch = ''
29 # https://github.com/pnuckowski/aioresponses/pull/278
30 substituteInPlace aioresponses/core.py \
31 --replace-fail asyncio.iscoroutinefunction inspect.iscoroutinefunction
32 '';
33
34 nativeBuildInputs = [
35 pbr
36 setuptools
37 ];
38
39 propagatedBuildInputs = [ aiohttp ];
40
41 pythonImportsCheck = [ "aioresponses" ];
42
43 nativeCheckInputs = [
44 ddt
45 pytestCheckHook
46 ];
47
48 disabledTests = [
49 # Skip tests which make requests to httpbin.org
50 "test_address_as_instance_of_url_combined_with_pass_through"
51 "test_pass_through_with_origin_params"
52 "test_pass_through_unmatched_requests"
53 ];
54
55 meta = {
56 description = "Helper to mock/fake web requests in python aiohttp package";
57 homepage = "https://github.com/pnuckowski/aioresponses";
58 license = lib.licenses.mit;
59 };
60}