nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, aiohttp
3, buildPythonPackage
4, fetchFromGitHub
5, fetchpatch
6, jsonrpc-base
7, pytest-aiohttp
8, pytestCheckHook
9, pythonOlder
10}:
11
12buildPythonPackage rec {
13 pname = "jsonrpc-async";
14 version = "2.1.0";
15 format = "setuptools";
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchFromGitHub {
20 owner = "emlove";
21 repo = pname;
22 rev = version;
23 hash = "sha256-Lr8gvQR0Q46b/e1K/XyvqtJo18nBpHjlDdNq4vjCMyU=";
24 };
25
26 propagatedBuildInputs = [
27 aiohttp
28 jsonrpc-base
29 ];
30
31 checkInputs = [
32 pytest-aiohttp
33 pytestCheckHook
34 ];
35
36 patches = [
37 # Fix tests with later pytest-aiohttp, https://github.com/emlove/jsonrpc-async/pull/9
38 (fetchpatch {
39 name = "support-later-pytest-aiohttp.patch";
40 url = "https://github.com/emlove/jsonrpc-async/commit/8b790f23af0d898df90460029d5ba3bcfb0423ed.patch";
41 sha256 = "sha256-rthHRF90hywMIbvIHo3Do/uzXKe+STPOoZIa80H4b/g=";
42 })
43 ];
44
45 pytestFlagsArray = [
46 "tests.py"
47 ];
48
49 pythonImportsCheck = [
50 "jsonrpc_async"
51 ];
52
53 meta = with lib; {
54 description = "A JSON-RPC client library for asyncio";
55 homepage = "https://github.com/emlove/jsonrpc-async";
56 license = licenses.bsd3;
57 maintainers = with maintainers; [ peterhoeg ];
58 };
59}